Re: [xSocket-develop] DataInputStream
Status: Inactive
Brought to you by:
grro
|
From: Gregor R. <gre...@go...> - 2008-03-19 06:54:54
|
Hi Ricardo, the NonBlockingConnection and the BlockingConnection implements the NIO interfaces ReadableByteChannel and WritableByteChannel. By using the NIO utility class Channels these channels can be mapped into classic input and output streams. Because the classic streams do have a blocking behaviour, the mapping to an input stream should only be done based on the BlockingConnection. See http://xsocket.svn.sourceforge.net/viewvc/xsocket/xsocket/core/trunk/src/test/java/org/xsocket/connection/ClassicStreamTest.java?view=markup for an example. Please note, that you will lost the benefit of the non blocking reading (especially on the server side) by doing this. Means, by mapping a NonBlockingConnection (after wrapping it with a BlockingConnection) to a stream each open connection consumes a dedicated thread. This is the same behaviour like the classic stream approach. For this reason the scalability is as good/bad as for classic streams. Unfortunately, just mapping the channels to streams will not improve the scalability or response time. But this can be a first step of a refactoring. cheers Gregor 2008/3/19, Ricardo Lecheta <ric...@te...>: > > Hi all, > > I have a J2ME application that use a socket to communicate with the my > server application. > > Both applications read/write using the DataInputStream/DataOutputStream. > > I would like to refactor the server side to some high performance NIO > framework like xserver, > but I didn't find anything to use the DataInputStream, just the readStringByDelimiter > methods. > > is there a way to just refactor my server application without change my > client? > > thank you, > Ricardo > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Microsoft > Defy all challenges. Microsoft(R) Visual Studio 2008. > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ > _______________________________________________ > xSocket-develop mailing list > xSo...@li... > https://lists.sourceforge.net/lists/listinfo/xsocket-develop > > |