Wojciech Kocjan wrote:
>
> 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

You have to store the pointer into a hash table in you c code and then
return the tcl name of the pointer to tcl.

I do this in my jabber module, implicilty by returning a reference to a
jconn. The c module is located at
http://zmbh.com/nsjabber/nsjabber/nsjabber.c

When tcl uses the name of the connection, you have to use the name to
get the pointer.

--Tom Jackson

Reply via email to