Fog Creek Software
Discussion Board




Welcome! and rules

Joel on Software

Non-blocking I/O

How do you do the following with DotNet:

How do you create a server similar to unix daemons that uses the select()/poll() event loops to handle multiplexing of incoming reads and outgoing writes and the logic that drives them?

And if possible, will these non-blocking code map to SSL/TLS service providers?

I saw in the Docs some reference to select() and an asynchronous write/read system, but I don't know if they map to something like select()s and poll()s in the underlying Windows 2000 API.

JDK 1.4 has Non-blocking i/o based on selects(), but the biggest problem with it is that the SSL packages that you can add to JDK 1.4 doesn't seem to work with it.

So far I have been forced to work with C examples:
http://bytesex.org/webfs.html
THTTPD also exist in a SSL-enabled version because some grad student wrote it.

The only Non-blocking SSL API for Java project is from academia:
http://www.cs.berkeley.edu/~mdw/proj/seda/'s ATLAS libraries.

I can be quite cloudy in my question, so I will follow up with clearer questions in Post-to-self follow-ups.

Li-fan Chen
Thursday, September 19, 2002

I can't say much about SSL, but the .NET Framework networking classes (NetworkStream, etc.) support the standard IAsyncResult pattern for doing async I/O. There is sample code for an async server at http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cpconblockingserversocketexample.asp that might be interesting (in VB.NET, unfortunately).

Walter Smith
Thursday, September 19, 2002

*  Recent Topics

*  Fog Creek Home