I am trying to send a set of values (~25) every 200 ms but the project is currently set up in a way that I have to connect to a socket(same port) for each value, send the message and disconnect from it.
It means I connect and disconnect 25 times every 200 ms.
It is possible to have such a high frequency of connections? Is there a limit to this?
here is the pseudo code
func(ByteBuffer packet)
{
-------
if ( packet != null )
{
synchronized( tcpClientConnection)
{
if ( tcpClientConnection.connect() )
{
retval = tcpClientConnection .send( buf );
}
tcpClientConnection.disconnect();
}
}
-----
}
requiresa connect/recv/disconnect sequence for each data item, you have no choice. However, if it allows connect/recvall/disconnect, the do what @learningJava suggests