[Home] [Groups] - Message: [Prev in Group] [Next in Group]

nu.kanga.list.mud-dev

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

[Full Header] [Plain Text]
From: Chris Gray <cg@ami-cg.GraySage.Edmonton.AB.CA>
Newsgroups: nu.kanga.list.mud-dev
Date: Wed, 5 Aug 1998 07:27:43 -0600
Organization: Kanga.Nu
[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@ami-cg.GraySage.Edmonton.AB.CA