[AOLSERVER] Sharing a socket between C and TCL

2002-01-07 Thread Wojciech Kocjan

Hello.

I've written a small C based daemon listening on 999 port. It doesn't do
much, but I want to move some of the functions from C to TCL.

I'm using Ns_SockListenCallback() and have SOCKET to work with. How do I
allow Tcl to use this socket?

--
WK



Re: [AOLSERVER] Sharing a socket between C and TCL

2002-01-07 Thread Scott Goodwin

If you're creating the socket in your C module using Tcl channels, I think
you just need to get the socket id back and use the standard puts, gets and
so on.

If you aren't using Tcl channels, you'll need to create your own Tcl
commands and use them to read/write bytes.

See nsopenssl for an example of using Tcl channels. I had to create my own
new channels. You should only have to use the standard Tcl channel already
defined for sockets.

/s.


 Hello.

 I've written a small C based daemon listening on 999 port. It doesn't do
 much, but I want to move some of the functions from C to TCL.

 I'm using Ns_SockListenCallback() and have SOCKET to work with. How do I
 allow Tcl to use this socket?

 --
 WK