I know that it is not easy to bind a port number to TCP socket that you would use to send data (because systems usually bi
You can simply call bind() before connect() in a client in the same way that you would call bind() before listen() in a server. There is nothing more complicated to it than that.
bind()
connect()
listen()