MUD-Dev
mailing list archive
[ Other Periods
| Other mailing lists
| Search
]
Date:
[ Previous
| Next
]
Thread:
[ Previous
| Next
]
Index:
[ Author
| Date
| Thread
]
Re: [MUD-Dev] How to support 1000+ simultaneous connections, and some philosophy.
[Ben Greear:]
>I don't mind researching and reading man pages, but could you give
>me some hints as to how this is done? Does it involve forking?
>Something special to do with sockets? How does the handoff occur?
It was at work we did this, so I might get some details wrong. Under
BSD-style, you use the 'control' stuff in 'sendmsg', 'rcvmsg'. You just point
to the int fd you want to pass/get and use a length of 4. Beware, since you
are passing a stream of bytes, its remotely possible for not all 4 to get
there at once. The system knows what it is doing and will translate the fd
number in the sending process into a new one in the receiving process. The
sender should then close the socket so as to reduce its fd count.
... checking man pages here on Linux ...
Hmm. 'sendmsg' not implemented in Linux 0.99.11. Waaaaay back! That doesn't
say anything about Linux 2.0.30, etc! See SCM_RIGHTS in 'rcv' man page.
For SYSV-style sockets, it is ioctls on sockets that do it. You open
a UNIX-domain socket (attached to a file path) in each process and use
special ioctl's to pass an open fd from one to another. I can't find
info on it here on Linux, but it was something like SIOSNDFD/SIORCVFD or
something. Email me at cg#myrias,com and I can get you sample sources.
This question came up before, so if you search the archives, you might
find more details, like whether or not Linux supports this. It *is*
supported in SunOS4, Solaris, AIX and HP-UX, although all except SunOS4
use the SYSV method, which I can't remember or find much about right now.
--
Don't design inefficiency in - it'll happen in the implementation.
Chris Gray cg#ami-cg,GraySage.Edmonton.AB.CA
http://www.GraySage.Edmonton.AB.CA/cg/
_______________________________________________
MUD-Dev maillist - MUD-Dev#kanga,nu
http://www.kanga.nu/lists/listinfo/mud-dev
- Thread context:
- Re: [MUD-Dev] How to support 1000+ simultaneous connections, and some philosophy., (continued)
- Re: [MUD-Dev] How to support 1000+ simultaneous connections, and some philosophy.,
Chris Gray cg#ami-cg,GraySage.Edmonton.AB.CA, Thu 11 Mar 1999, 04:03 GMT
- Re: [MUD-Dev] How to support 1000+ simultaneous connections, and some philosophy.,
Chris Gray cg#ami-cg,GraySage.Edmonton.AB.CA, Thu 11 Mar 1999, 15:05 GMT
- Re: [MUD-Dev] How to support 1000+ simultaneous connections, andsome philosophy.,
Dominic J. Eidson sauron#the-infinite,org, Thu 11 Mar 1999, 20:27 GMT
- Re: [MUD-Dev] How to support 1000+ simultaneous connections, and some philosophy.,
J C Lawrence claw#varesearch,com, Fri 12 Mar 1999, 02:32 GMT
[ Other Periods
| Other mailing lists
| Search
]