Works great in Dolphin Smalltalk - Finally have websockets - WeOnlyDo Discussion board

Works great in Dolphin Smalltalk - Finally have websockets (wodWebServer / wodWebServer.NET)

by Jacob W, Saturday, December 01, 2018, 04:08 (1935 days ago)

Just wanted to say thanks and I'm glad to finally have a solution for a Websocket server in dolphin smalltalk (my goal is to make multiplayer web games).

The activex and COM load great in dolphin and preliminary testing is going well. I have yet to test with 40+ users all sending and receiving data but I'm guessing it'll do fine.

I had a request though, could you support sending and receiving of Binary data on the Websocket server?

Thanks - Jacob

Works great in Dolphin Smalltalk - Finally have websockets

by wodSupport, Saturday, December 01, 2018, 08:33 (1935 days ago) @ Jacob W

Hi Jacob,

wodWebServer's webSocket implementation should handle binary data, why do you think it can't?

You can always send HEX values or BASE64 values if you want to avoid raw binary data (which may be harder to handle in string variables), but even raw data should work.

How do we duplicate your problem?

Kind regards,
Jasmine.

Works great in Dolphin Smalltalk - Finally have websockets

by Jacob W, Saturday, December 01, 2018, 09:13 (1935 days ago) @ wodSupport

Hi Jacob,

wodWebServer's webSocket implementation should handle binary data, why do you think it can't?

You can always send HEX values or BASE64 values if you want to avoid raw binary data (which may be harder to handle in string variables), but even raw data should work.

How do we duplicate your problem?

Kind regards,
Jasmine.

Oh, I didn't realize it could already do it. The only websocket methods I see in the documentation and the generated COM controls is WebUser>WebSocketSendText and WebSocketReceiveText. The documentation shows:

object.WebSocketSendText (Text)
The WebSocketSendText(object,Text) syntax has these parts:
object An expression evaluating to an object of type WebUser
Text A string value that should be sent to WebSocket user.

So I am a bit confused about how to send binary data like a Float or Unsigned Int 8, 16, 32, etc.

Works great in Dolphin Smalltalk - Finally have websockets

by Jacob W, Saturday, December 01, 2018, 09:18 (1935 days ago) @ Jacob W

So I thought about it a bit and I realized maybe its as simple as converting my data into the appropriate character for each byte? Since a char is 1 byte... I apologize if this is the obvious answer.

Works great in Dolphin Smalltalk - Finally have websockets

by wodSupport, Saturday, December 01, 2018, 09:33 (1935 days ago) @ Jacob W

Hi.

In theory, yes, but it's still binary data. That is why I suggested to use HEX representation (two bytes per byte, only chars 0-9 A-F) and that can travel throgh any media.

Jasmine.