Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / Issues with GetSocketString(SocketID)

Author
Message
BuccaneerBob
AGK Developer
14
Years of Service
User Offline
Joined: 18th Aug 2010
Location: Canada
Posted: 31st Jul 2016 00:55
I've got a question to bounce off of some of those developers out there familiar with AppGameKit Sockets.

I've got a Server written in VB.NET and a Client written in AGK2.20. The connection between the client and server gets established fine, the client can send a string to the server, the server is able to print the string to a textbox no problems. When I try to send a string to the client from the server, the client locks up when doing GetSocketString(SocketID). The string is created server side with a 4 byte length value first which is appended to the front of the string being sent. If I call GetSocketBytesAvailable(SocketID) on the client, it shows the proper number of Bytes in the string that it has received, but when I call GetSocketString(SocketID), the application goes not responding. As soon as I shutdown the server and terminate the connection from the server though (by killing it server-side), the AppGameKit application resumes and starts responding, and it prints the string sent from the server OK. Is there something I should be calling after GetSocketString(SocketID) to complete receiving the packet, similar to the FlushSocket(SocketID) when you send data?

Thoughts?

Rob
Robert Janes (Samu Games)
http://www.samugames.com/artifact
BuccaneerBob
AGK Developer
14
Years of Service
User Offline
Joined: 18th Aug 2010
Location: Canada
Posted: 31st Jul 2016 02:12
Disregard, fixed it server side, had to call the Socket.Send 4 Byte Length Value, then Socket.Send String and it worked fine.
Robert Janes (Samu Games)
http://www.samugames.com/artifact
BuccaneerBob
AGK Developer
14
Years of Service
User Offline
Joined: 18th Aug 2010
Location: Canada
Posted: 31st Jul 2016 02:12
Fixed it server side,

I was calling Socket.SendData only once, I had to do Socket.SendData Len(String) and Socket.SendData String and it worked fine now.
Robert Janes (Samu Games)
http://www.samugames.com/artifact

Login to post a reply

Server time is: 2024-11-25 04:00:59
Your offset time is: 2024-11-25 04:00:59