I'm interested in writing a multiuser game server using scsh, one
where clients can connect, log in, and interact with other
clients. This requires non-blocking sockets, so that the server can
process current clients while accepting new ones. As scsh doesn't
currently support threads, the only way I've found to be able to do
this is to use a big event loop, selecting on all the user sockets and
the accept socket. Unfortunately, the scsh select function doesn't
seem to want to take any sockets I feed to it, claiming it's a bad
argument; it only likes small integers and fdports. The man page for
accept(2) claims:
It is possible to select(2) a socket for the purposes of
doing an accept by selecting it for read.
so I was wondering if it would be possible to allow sockets to get
through select's type checking.
Or any other way to get what I want that I've missed.
Thanks,
Jin
|