Is port number always be 19997

Typically: "How do I... ", "How can I... " questions
Post Reply
xzbreeze
Posts: 11
Joined: 05 Dec 2016, 16:21

Is port number always be 19997

Post by xzbreeze »

Hi everyone

I am new to V-rep. I am trying to use remoteApi C and Matlab. It seems that 19997 works for those two remoteApis. I am not familiar with the term "port number". Does 19997 is always the correct port number for different remoteApi?

Thanks

bracco23
Posts: 5
Joined: 21 May 2016, 14:52

Re: Is port number always be 19997

Post by bracco23 »

The remote API uses sockets (like in internet sockets) to pass messages.

Each socket has a port number, with allows you to "route" the messages to the right server. In this case, a server is run by V-Rep that listen, by default, on port 19997.

Each different API (C, Matlab, Python, etc..) just connects to this server and send the right commands. So yeah, as long as you don't change it, the port will be the same for all different languages.

Beware that if you run two differens clients (lets say a C application and a Matlab Script), they will connect on the same server and possibly interfere with each other (if you run the simulation from one side, you can stop it from the other and it will be stopped for both the clients).

coppelia
Site Admin
Posts: 10378
Joined: 14 Dec 2012, 00:25

Re: Is port number always be 19997

Post by coppelia »

Hello,

yes, correct. But basically, it is better practice to open yourself another port when you are using the remote API. You can do this inside of a script with simExtRemoteApiStart(portNumber). Then you can be sure that the port is not already occupied by another remote API client you might not know of.

Cheers

Post Reply