NIO, IO, and SSL facilitation code

Rather than repost a whole bunch of info, I’ll just post a link:

http://www.realityinteractive.com/rgrzywinski/archives/000091.html

I read these forums infrequently so if you have a question or problem, post a comment in the blog. This way the information is centralized.

Posts with no content and just a random link aren’t very appealing, so … here’s a copy/paste of that link’s content:

…and, since that carefully avoids mentioning what on earth it actually is ;D, a bit more link following will you get you:

It sounds interesting, but unfortunately each of the links cited “for more information” just forms an infinite link circle cyling between two pages with no info, so I’m not sure precisely what it does.

The description above could mean, well, anything really, from the exciting “makes SelectableChannel’s out of old IO streams” to the mundane “a network library which abstracts between IO and NIO” (mundane because such a network library isn’t going to be powerful - you can’t easily hide the differences without ridding yourself of most of the advantages of NIO in the first place).

If anyone finds docs on his site, please let me know, since I’d be interested to see what this is (but I’m not going chasing someone who posts a teaser without a description with the rider that they’re not going to check back here so don’t ask any questions, and whose links don’t seem to have any explanatory notes)

It annoys the snot out of me to have the same info posted in multiple locations (like having 5 different forums with the same questions and answers). We have these wonderful hyperlinks for a reason ;D

Thanks for putting up the info blahblahblahh.

There’s a goodly chunk of IO and NIO code in there and a lot of Pipe information. If you’re in need of some networking examples including SSL then it may be something to look at.

The release notes:

http://www.realityinteractive.com/software/oss/nio_ssl.txt

contain a good deal of information.

[quote]an infinite link circle cyling between two pages with no info
[/quote]
It’s interesting that you say that. I went to great lengths to ensure that all entries go back to the main NIO and SSL post which has references to all of the relevant information. I’m open for suggestions (that don’t involve replicating data) about how to better organize. I will admit that it’s not for the faint of heart.

PS: in case you were wondering, SSL-over-NIO is one of the core features of 1.5. IIRC Sun has no plans to back-port it to 1.4 (just as with logging and regex, which are 1.4-only), so unless NIO2 + 1.5 NIO turn out to be a LOT more reliable than 1.4 NIO, SSL users mostly will be stuck without it for a few years yet.

Which is why Rob’s link is tantalizing…

[quote]It annoys the snot out of me to have the same info posted in multiple locations (like having 5 different forums with the same questions and answers). We have these wonderful hyperlinks for a reason ;D
[/quote]
Yeah, I know. You have to strike a careful balance. But I think you could have given a bit more information ;D

Anyway…my link-following skills are often less-than-perfect, so is there a handy link that explains all? I read the release notes, the blog entry, and the main site, but still I’m not sure what you’ve done…?

As for what it is … there’s not one answer. Originally I wanted to get SSL working with NIO using 1.4 since I have a lot of NIO code that now needs to work over SSL. That’s obviously not going to happen out of the box. So I started to determine how close I could get and that led to “Converted IO” (which essentially converts InputStream and OutputStream to a ScatteringByteChannel and GatheringByteChannel, respectively, using Pipes). Pipes turned out to be a fiasco.

There’s a bunch of Echo servers in there (using IO, NIO, Converted IO and Converted IO with a Selector) and sutiable clients.

Oh, and there’s a couple of factories for creating SSL and plain sockets to simplify the whole ugly process.

I’m still sorting out what a best answer is, especially given the crappy performance of the Converted IO with Selector.

[quote]Pipes turned out to be a fiasco.
[/quote]
I’ve never had a use for them (in java), and I’ve searched long and hard to find people using them in the field to no avail, so I’d be interested to hear your thoughts on them in particular.

(but could you start a thread in networking instead, since we can’t move threads from here and that’s the best place for it?)

Ask and ye shall receive:

http://www.java-gaming.org/cgi-bin/JGNetForums/YaBB.cgi?board=Networking;action=display;num=1093025002