A new socket implementation / api
Noctarius
me at noctarius.com
Wed Aug 24 07:24:42 PDT 2011
Am 23.08.2011 11:23, schrieb Alan Bateman:
> At some point we should go back to it but I'm not aware of any
> immediate plans. One thing that was an issue at the time was
> multiplexing (via the Selector) pipes and sockets on Windows.
Yeah that's a problem I'm trying to address in my JNA based
implementation at the moment. There's a beginning what needs at
least one thread and selects all pipe-connects one by one. That's no
real nice implementation of a Selector but WinAPI for Named Pipes
does not seem to have any support of something like select().
> By
> "protocol stuff" then I assume you mean java.net.ProtocolFamily and
> java.net.StandardProtocolFamily. These were added as part of the
> multicast support in Java SE 7.
>
Yeah I guess that's what I meant. Haven't had a deeper look to it,
but I'll do.
A third thing:
I started with talking about a new implementation. Since I'm already
done some kind of new socket framework (the one using JNA for Unix
Domain Sockets and Named Pipes and Java's sockets for TCP), I came
to the point where it was a lot easier to work with an event based
implementation.
What does it mean?
Well you create a ServerSocket and tell him to listen for incoming
client request (bind()). At the other side you open a ClientSocket
to connect to the already opened server.
Now you can give both sockets a listener to retrieve events like
"clientConnected", "clientDisconnected", "dataReceived", ... by
adding such a listener with "listen(...)".
The rest is in scope of the actual used socket implementation.
Are there opinions or sugestions about such an implmentation I
haven't thought about? I would be nice to see otehrs opinions.
> -Alan
Chris
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 4510 bytes
Desc: S/MIME Kryptografische Unterschrift
Url : http://mail.openjdk.java.net/pipermail/nio-discuss/attachments/20110824/f69d389d/attachment.bin
More information about the nio-discuss
mailing list