[DGD] Changing connect() (network package)
bart at wotf.org
bart at wotf.org
Tue Jan 1 01:43:18 CET 2008
On Mon, 31 Dec 2007 16:29:14 -0800, Shentino wrote
<snip of lots of stuff I agree with..>
>
> What if the mudlib wants to request an action? It gets sent to the
> network daemon, and it handles it. But what if the daemon can't do
> what was asked? Like, opening a port that happens to be taken, or is
> privileged, or otherwise cannot respond? Now we have the mudlib
> having already finished an ER expecting to call certain services
A similar problem already exists in the current network package that I
maintain, and actually was the origin of this thread if I'm not mistaken.
When you use connect() it will succeed unless there is an inmediately obvious
problem (having run out of file descriptors or user objects being the obvious
candidates).
The actual connect happens after control is already returned to LPC, and
depending on the result of this connect one of 2 things happen:
open() is called in case of success
receive_error() is called with the error as reported by the operating system
as argument in case of failure.
That connect() itself does not return an error is no promise whatsoever that
the connection is (going to be) made. It is a promise that you will get back a
report about succes or failure of a connection you asked for.
I'd imagine an external daemon could use a way to report back a failure, and
this could be handled in a similar way. It does also mean that it has to
report succes ofcourse.
Bart.
--
Created with Open WebMail at http://www.bartsplace.net/
Read my weblog at http://soapbox.bartsplace.net/
More information about the DGD
mailing list