I looked through the RawSocketsMBS docs and really couldn’t see any properties that would help.
@Meestor_X not to keep you testing but I have been using Chilkats plugins for network connectivity (oAuth2, etc). I wonder if their tcp sockets are faster?
Declare Function setsockopt Lib "Ws2_32.dll" Alias "setsockopt" ( _
s As Integer, _
level As Int32, _
optname As Int32, _
ByRef optval As Boolean, _
optlen As Int32 _
) As Int32
Const IPPROTO_TCP = 6
Const TCP_NODELAY = &h0001
Dim noDelay As Boolean = True
Dim noDelayLength As Int32 = 1 'byte length of noDelay
Dim ok As Int32 = setsockopt(YourSocketGoesHere.Handle, IPPROTO_TCP, TCP_NODELAY, noDelay, noDelayLength)
You listen on a port. Then you get later a DataAvailable event. There you can accept the request, which gives a new socket. In this mode you basically run it as ServerSocket.
So, the RawSocketMBS is only 3x slower than .NET, and I can’t see any parameters that would speed that up further.
I would expect that using Threads would not increase the speed any (just reading one socket’s data and sending it to the other with no processing)…
Overall the answer by disabling Nagle’s algorithm should only yield back some hundredths of a millisecond and it really only affects larger packet sizes (usually larger fragmented payloads). Granted since the 90s all Cisco engineers have disabled “No Service Nagle” until it was default in newer Cisco OSs.
Overall try it but I will be surprised if you notice anything.
Thank you, Mike. @npalardy and I looked at it and the Xojo TCPSocket is definitely very slow in comparison to the .NET socket.
Since it requires specialized hardware that I have in my house to test, I’m not sure what good the code would do since you can’t test it.
However, I’d be happy to zoom with you to show you the issue if you’re curious.