When started with --props=socket,bi,5,localhost,5501,tcp fgfs does only
allow one session e.g. via telnet. After closing this session, it isn't
possible to connect again.
I had a look at that problem and seem to have found the reason. Yet
I cannot provide a patch. On the one hand I'm not really familiar with
socket programming. On the other hand I didn't completely understand
how fgfs is supposed to deal with this socket stuff and I would probably
break more than I would fix. Anyway, here is my diagnosis: :-)
simgear/sg_socket.cxx doesn't accept(2) a pending connection and hence
get a session handle. Instead, it works with the server socket handle
that it got from socket(2). While this works for the first connection,
it makes "quit" cancel the server(!) instead of the session. (Of course,
one should be able to install a new server, but this wouldn't be a clean
solution.)
Unfortunately, there doesn't seem to be a place where an accept(2) call
would fit in. Ideally, there would be a forked off process that cares
for socket connections and would simply wait until accept(2) returns,
or at least something like SGSocket::process that would regularly be
called by FGProps::process and would start the session. Now the first
function that is polled is SGSocket::readline, in which an accept(2)
call would IMHO be already too late.
Hmm ... (?)
m.
_______________________________________________
Flightgear-devel mailing list
[EMAIL PROTECTED]
http://mail.flightgear.org/mailman/listinfo/flightgear-devel