InfoQ

News

xSocket Aims to Keep NIO Simple

Posted by Craig Wickesser on Apr 30, 2008 08:45 PM

Community
Java
Topics
Release
Tags
Java SE,
NIO,
xSocket
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

Reply

Exclusive Content

Rationalizing the Presentation Tier

Thin client paradigm characterized by web applications is a kludge that needs to be repudiated. Old compromises are no longer needed and it's time to move the presentation tier to where it belongs.

Agile Project Management: Lessons Learned at Google

In this presentation filmed during QCon 2007, Jeff Sutherland, the creator of Scrum, talks about his visit at Google to do an analysis of Google's first implementation of Scrum.

AtomServer – The Power of Publishing for Data Distribution

In this article, Bryon Jacob and Chris Berry introduce AtomServer, their implementation of a full-fledged Atom Store based on Apache Abdera, which is now available as open source.

An Introduction to Virtualization

It is easy to think that virtualization applies only to servers. In reality the recent resurgence of the concept is also being applied to networking, storage, and application infrastructure.

REST Anti-Patterns

In this article, Stefan Tilkov explains some of the most common anti-patterns found in applications that claim to follow a "RESTful" design and suggests ways to avoid them.

Choosing between Routing and Orchestration in an ESB

In this article, Adrien Louis and Marc Dutoo discuss the differences and relative merits of using orchestration vs. routing in a typical ESB setup, and discuss various implementation options.

Enterprise Batch Processing with Spring

Wayne Lund discusses batch processing, Spring Batch objectives and features, scenarios for usage, Spring Batch architecture, scaling, example code, failures and retrying, and the future roadmap.

User Story Estimation Techniques

Developer Jay Fields draws on his experiences as a ThoughtWorks consultant to describe effective user story estimation techniques.