Forum OpenACS Development: tcl with sockets ???

Collapse
Posted by Boris Kruvshenko on
Hi all.

Anybody knows if it is posible to develop a tcl socket on the openacs to send/receive xml data from an xmlsocket flash object ??

Thx.

Collapse
2: Re: tcl with sockets ??? (response to 1)
Posted by Andrew Piskorski on
What is an "xmlsocket flash object"?
Collapse
3: Re: tcl with sockets ??? (response to 1)
Posted by Boris Kruvshenko on
An xmlsocket flash object is no other that a socket client which only sends xml data to a server. My question is if it is posible to develop an tcl socket server in/for the openacs (in this case, it will receive xml data from flash).

Thx.

Collapse
4: Re: tcl with sockets ??? (response to 3)
Posted by Malte Sussdorff on
If I'm not utterly mistaken, yes it is, and you can look at it in the jabber code for nsd-jabber.
Collapse
5: Re: tcl with sockets ??? (response to 1)
Posted by Boris Kruvshenko on
Hi Malte... could you be more specific ?? what is the "jabber code" ?? where can I find it & how can I use it ??

I´m sorry, I´m begginer.

Thx.

Collapse
6: Re: tcl with sockets ??? (response to 5)
Posted by Malte Sussdorff on
Look in the package "jabber" in the c section (contrib/packages/jabber/c). There you will find code for nsjabber which should give you some hints (albeit in C) on how to achieve what you want within the AOLserver.

Sadly this is not for beginners, so unless you know C and something about socket programming and threading, it might not be of much use to look at this.

Last but not least, this code was written by Björn Kiesbye, so you might want to contact him directly if you have questions.

Collapse
7: Re: tcl with sockets ??? (response to 1)
Posted by Andrew Piskorski on
Boris, you shouldn't need to write any C code at all just to do TCP/IP sockets in AOLserver. There are Tcl commands for that. Look at the 11 or so ns_sock* AOLserver Tcl API commands. Stock Tcl also has its own socket command which you should be able to use from AOLserver as well. Note that the AOLserver ns_sendmail Tcl command is in fact implemented entirely in Tcl, no C code, and uses those socket commands to talk to an SMTP server.

You might eventually want to write C code though, in order to take advantage of fancier AOLserver features. I'm not familiar with this, but people have used both AOLserver 3.x and 4.x to implement (high performance, I think) non-HTTP servers in AOLserver, e.g. SMTP, POP3, and DNS servers. Currently that requires patches to AOLserver 4.x, but people are working on integrating those patches in the stock AOLserver release. See in particular SourceForge Feature Requests 726288 and 973010.