[Freeswitch-users] mod_spidermonkey_socket

Jonas Gauffin jonas.gauffin at gmail.com
Wed Aug 22 00:25:28 PDT 2007


Hello

I have a spidermonkey socket module that aren't finished, it uses the
switch_socket_XXX methods. I can't work anymore on it for at least a
month, and there are som users waiting for a socket module. Therefore
it would be nice to add it to the trunk so that others can complete it
(or at least test it).

It currently got the following methods: connect, close, send, readBytes, read.

The question is: Should I create a patch for it and document it in the
wiki? Or should I wait until I can complete it.

Note! It's completely untested.

usage:
var socket = new Socket();
socket.connect("hostname", 1234");
var line = socket.read();
socket.send("this is something\n");

The read method takes a delimiter and do not return until the
delimiter have been received (or the connection have been dropped).
The default delimiter is "\n".
The readBytes method reads the number of specified bytes.

I've only made a TCP socket implementation. For simplicity, maybe
there should be two socket classes. One for UDP and one for Tcp.

//Jonas




More information about the FreeSWITCH-users mailing list