[MUD-Dev] Re: Socket-Script: Socket-capabable script language and matching library

Chris Gray cg at ami-cg.GraySage.Edmonton.AB.CA
Wed Aug 5 07:27:43 CEST 1998


[Adam J. Thornton:]

 >Any thoughts?  How do I cleanly manage the handoff of a socket connection
 >from one process into a preexisting and already-initialized process?

On BSD-style systems, you can do it with the 'send' and 'recv' calls.
For example, see the 'SOL_SOCKET/SCM_RIGHTS' paragraph in the 'recv'
man page (at least that's where it is on this Linux box). I recall it
being more ad-hoc for some other UNIX'es (I did this at work). It is
always passed in the 'msg_control'/'msg_controllen' fields, however.
For SYSV-style systems, there are stream ioctls that you use to pass an
open fd from one process to another. If you have to do it on an old AIX
system, let me know - without a certain patch, doing this can crash
the system hard. Oh yes, if you are using WIN32, I'm not sure - you
would have to check for a DuplicateHandle-style call in winsock.

--
Chris Gray     cg at ami-cg.GraySage.Edmonton.AB.CA




More information about the mud-dev-archive mailing list