InfoQ

News

xSocket Aims to Keep NIO Simple

Posted by Craig Wickesser on Apr 30, 2008

Community
Java
Topics
Release
Tags
xSocket ,
Java SE ,
NIO
Gregor Roth recently released xSocket 2.0, a NIO-based Java library for building high performance and scalable networking applications. InfoQ had an opportunity to interview Gregor and touch on the history of xSocket, the latest release and future plans for the library.

InfoQ: What is the history of xSocket?

Gregor Roth: The initial version of xSocket is a spin-off, of a high performance SMTP server evaluation project. The common, NIO-related network code has been reimplemented as xSocket. In July 2006 the first public version of xSocket (V0.8) has been released. With xSocket 1.0 the API has been completely redesigned. The later versions of xSocket (V1.1 and 1.2) enhanced the API by adding new methods, classes and functionality.

InfoQ: What are the major new features or bug fixes in 2.0?

GR: Beside minor changes, renaming and removed deprecated artefacts, the xSocket v2.0 main API is equals to the xSocket V1.2 API. The most important changes are the new extension modules and the reimplemented internal components.

Major issues of xSocket V2.0 are:

  • [API] API-cleaning by removing deprecated artefacts and minor changes.
  • [API] New execution annotation support. Based on the new execution annotations the user can define if the call back methods of his network handler should be executed in single threaded mode or multithreaded mode.
  • [Deployment] xSocket binaries are now OSGi conform
  • [Monitoring] Improved JMX-Monitoring
  • [Performance] Significant performance improvements by reimplementing xSocket's low-level code
  • [SSL] reimplemented SSL support
  • [Resources] Improved suspend and resume read support by auto detaching and reattaching the socket's SelectionKey to the Selector, which reduces the resource requirements.
New extension modules (early access):
  • xSocket-multiplexed, supports running several logical connections on the top of one physical TCP connection.
  • xSocket-http, supports writing synchronous and asynchronous HTTP client and server components. xSocket–http includes a HttpClient and helps to write event based HTTP network components such as HTTP proxies or COMET server applications by providing an asynchronous, streaming API.

InfoQ: What are the future plans for xSocket?

GR: Socket 2.x:

  • Further performance optimizations (improved NIO-level file streaming support, ...)
  • [xSocket-http] improved COMET support (supporting the Bayeux protocol, …)
The next major version of xSocket (V3.0) will use NIO.2 features (NIO.2 will be part of JSE 1.7).

InfoQ: Any integration plans with JBoss, Glassfish, etc, similar to what Grizzly has done?

GR: Currently no specific integrations are planned.

If you have any questions about xSocket or would like to provide feedback to Gregor, he can be contacted via email at gregor DOT roth AT googlemail DOT com. You can also find more information about using xSocket for Asynchronous HTTP and Comet Architectures.

No comments

Watch Thread Reply

Educational Content

Rails in the Large: How Agility Allows Us to Build One Of the World's Biggest Rails Apps

Neal Ford shows what ThoughtWorks learned from scaling Rails development: infrastructure, testing, messaging, optimization, performance.

Stuart Halloway on Clojure and Functional Programming

Stuart Halloway discusses Clojure and functional programing on the JVM in depth, and touches on the uses of a number of other modern JVM languages including JRuby, Groovy, Scala and Haskell.

Orion Henry and Blake Mizerany on Heroku

Orion Henry and Blake Mizerany talk about the technology behind Heroku and the benefits of the new add-on system.

Security for the Services World

Chris Riley presents security issues threatening service based systems, examining security threats, presenting measures to reduce the risks, and mentioning available security frameworks.

Navigating The Rapids:Real-World Lessons in Adopting Agile

This talk investigates technical issues encountered when moving to an Agile process.

Codename "M": Language, Data, and Modeling, Oh My!

Don Box and Amanda Laucher present “M”, a declarative language for building data models, domain models or external DSLs. Don Box's demos show some of M’s features and latest changes of the language.

SOA Manifesto - 4 Months After

It is four months since the SOA manifesto was announced; InfoQ interviewed the original author’s to get insight into the motivations and the process behind the initiative.

Memory Barriers and JVM Concurrency

This article explains the impact memory barriers, or fences, have on the determinism of multi-threaded programs.