Hello
I'm sending a string from a non AppGameKit app to an AppGameKit app. It's semi working now.
The connection is made, but when the string is send, the AppGameKit app hangs, until I close the connection (from the non AppGameKit app)
Then the string is showed.
Why does the app hang? I think AppGameKit expects me to manually clear the buffer after GetSocketString (I think it hangs because it's constantly reading the string) however I cannot find a command to clear the buffer.
See my very simple code attached, does anyone see what I'm doing wrong here?
Thanks!
SetErrorMode(1)
SetWindowSize(600, 600, 0)
Msg As String
ConnectSocket(1, "127.0.0.1", 13244, 3000)
Do
if (GetSocketConnected(1) = 1)
Print("Connected!")
if (GetSocketBytesAvailable(1) <> 0)
msg = GetSocketString(1)
endif
else
Print("Disconnected !")
endif
Print(msg)
Print( ScreenFPS() )
Sync()
Loop
Edit: This is the ByteArray I'm sending: 00 00 00 04 54 65 73 74
The first 4 bytes indicate the length (4) and then an UTF-8 string "Test". But the string receives just fine, but only after I kill the connection (and the AppGameKit app stops hanging)
Thanks for any insight.