Well what I meant is this,
I have a 20 year old software that cannot be modified other than some
very basic things, like messages that can be sent through sockets...
if I send a message without any sort of a tag, through a socket, will
socket.io be able to interpret it as a normal "message" event?
what I want is to know how it receives the data, not how it's meant to
interact since I can easily change the sent message (from my software)
to a format that is easy to understand for
socket.io.
On 11 Out, 13:22, Jason Chen <
jhch...@gmail.com> wrote:
> >> I would like to know what's the message format that it uses when it
>
> comunicates, is it in JSON format?
> By default the format is a simple string, for example: socket.emit('your
> message');
> You can however, just do socket.json.emit({"key": "value"}); to send
> messages in JSON format.
>
> >> how can I send an event from a system that can't import libraries?
>
> What do you mean by send an event and what do you mean by can't import
> libraries? If you want to use socketio's event system (which you don't have
> to do), the sender would do socket.emit(eventname, data, function callback()
> { //do something... }); and the receiver would do socket.on(eventname,
> function fn() { //do something... }); Again if you want data to be in JSON
> format instead of a string, you can just do socket.json.emit instead.
>
> All this and much more can be found on the readme section ofhttps://
github.com/LearnBoost/socket.io
>
> Best,
> Jason Chen
>
> 2011/10/11 Gonçalo Vieira <
sandw...@gmail.com>