I have a device in which you must configure your IP and port, and also the IP and port of the PC to which you want to connect and send the data, via TCP.
The problem is that the device works as a TCP master and I must start the connection. And being the first execution of the program there is no problem, but if in less than 4 minutes (time of TIME_WAIT
) I start the program again it gives me the error:
Only one usage of each socket address (protocol / network address / port) is normally permitted
If I must always use the same port to send me the data, can the TCP connection of the previous execution be invalidated, or some other way to reuse the same ip-port pair in a short period of time? ?