Dim sock As Socket
sock.Initialize("sock")
Dim sockjo As JavaObject
sockjo = sock ' is a wrapper, not a socket
' get wrapper's socket
Dim actualsocket As JavaObject
actualsocket = sockjo.GetField("socket")
Dim isOn As Boolean = actualsocket.RunMethod("getTcpNoDelay",Null)
Log("is nagle on ? " & isOn)
If isOn Then
Log("will turn nagle off")
actualsocket.RunMethod("setTcpNoDelay",Array( False ))
Else
Log("will turn nagle on")
actualsocket.RunMethod("setTcpNoDelay",Array( True ))
End If
Log("is nagle on? " & actualsocket.RunMethod("getTcpNoDelay",Null))