Daniel Wippermann wrote:
> Hi Darin,
>
> sorry for the delay. Since I don't know how to include the three newly
> created files in the DIFF, I had to pack them in a ZIP file to attach
> it in Bugzilla in the first try. Now here are the files unpacked and
> already updated to the latest Mozilla source tarball. I hope it helps
> you...
no problem... but for future reference, you can cvs add the files to
your local tree, and then use cvs diff -uN to generate a diff that
includes the new files. it'd be good to add such a diff to the tree to
make it easier for others to review your changes.
a couple general things... i like the design for the most part, but
asyncListen should probably be called asyncAccept, and nsISocketListener
needs to be renamed to something more specific. how about
nsIServerSocketListener
it almost seems like you'd want to have an API to configure the socket
transport service to listen for incoming connections, the result of
which would be a nsISocketTransport object. so instead of using a
nsISocketTranport for the listener socket, we'd use some other
interface/object. it just doesn't feel right to clutter
nsISocketTransport, which represents a data pipe, with listen/accept
operations.
i almost think we need an api resembling:
nsISocketTransportService {
nsIServerSocket createServerSocket(in long port);
};
nsIServerSocket {
void asyncAccept(in nsIServerSocketListener listener, in nsISupports
ctxt);
};
nsIServerSocketListener {
void onNewConnection(in nsIServerSocket server, in nsISupports ctxt,
in nsISocketTransport connection, nsresult status);
};
the nsIServerSocket would still need to participate in the same PR_Poll
loop, which would mean changes to nsSocketTransportService to work with
something other than just nsSocketTransport objects.
I'm eager to hear what you think,
Darin
>
> Daniel
>
>
> Directories I had the newly created files in:
>
> netwerk/base/public
> nsISocketListener.idl
> netwerk/base/src
> nsSocketListener.cpp
> nsSocketListener.h
>