BOOST WIKI | RecentChanges | Preferences | Page List | Links List
Java 2 Standard Edition 1.5
Here is a UML diagram with the most important stuff of the net library in J2SE 1.5.
In Java there is not one hierarchy but several: Socket is for clients, ServerSocket for servers. Both support only streams - for datagrams you have to use DatagramSocket. All classes above support only blocking. You can set some timers to interrupt a blocking call but there is no real non-blocking. However Java 1.4 introduced multiplexing - I hope to create another UML diagram soon.
- The interface of the socket classes is slim as they support just one I/O model - blocking.
- As there are several socket classes and not just one helps creating slim interfaces again.
- Only blocking is supported (with the exception that Java 1.4 introduced multiplexing - I'll add a UML diagram later).
- The concept of a socket isn't very clear. We have several classes whose name is something with Socket but they are not related (they don't belong to one hierarchy).
- Naming isn't ideal either - class Socket should have been called ClientSocket as it can only be used for connecting, not for listening/accepting.
Disclaimer: This site not officially maintained by Boost Developers