How to fixed receiving port in TCPClient?

I want to fix receiving port number in TCPClient.
Is it possible ?

I use…



Are you calling setup with the IP and port number like this:

int port = 4232;
std::string address = "";
client.setup(address, port);


I was sorry for not explaining enough…

I’m making clientApp.
I want to fix the port number about this clientApp (clientPC).

One device of server sends command to fixed IPaddress , fixed port.
I need to receive that command by clientAPP.

(Device of server can not change the spec.)

Do you mean that you want to know the source port from the messages you send as the server uses that to respond to?


I want to fix source port.
I know it’s an unusual…

I try to that by O.S.

I had a similar problem. After looking around it should be an option but it is not implemented. I made a dodgy implementation for UDP, you can see it here. It worked but I doubt it is the best way to do it.

I know that the networking included in boost can do this,
I am not sure if any of the ofxBoost addon implementations have this functionality though.

You can also use sockets directly either from the POCO library as I tried (this makes it cross platform) or you can just code with sockets in your app.



Those are very interesting.
I will try!

However,I decided to make new device of server by programmable controller.
I don’t use existing server,on the network(local network of factory).

I come to think that is best way to the network for future development.

Thanks a lot.