TheNorwegianUser Posted October 29, 2015 Posted October 29, 2015 Hey!I have made one of my games so that it can be played multiplayer over a TCP connection, but it seems like TCPRecv() takes too much time, and creates an unwanted delay. I searched around in the forums, and all I found someone with the same problem, but I can't get their solution to work. Anyone knows a faster option than TCPRecv()?This is what they came up with:Func _TCPRecv($iSock, $iLen) Local $structBuffer = DllStructCreate("char[" & $iLen & "]") Local $aRet = DllCall("Ws2_32.dll", "int", "recv", "int", $iSock, "ptr", DllStructGetPtr($structBuffer), "int", $iLen, "int", 0) If @error Then SetError(1, 0, "") Return SetError(0, $aRet[0], DllStructGetData($structBuffer, 1)) EndFunc
SkythekidRS Posted November 2, 2015 Posted November 2, 2015 if string send is short. You can use UDP UDP Faster than TCP but just for small string.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now