Crossfire JXClient, Trunk
Protected Member Functions | Protected Attributes | Package Functions | Static Package Functions | Static Private Attributes | List of all members
ChannelIO Class Reference
Inheritance diagram for ChannelIO:
Inheritance graph
Collaboration diagram for ChannelIO:
Collaboration graph

Protected Member Functions

 ChannelIO (SocketChannel sc, boolean blocking) throws IOException
 
void resizeRequestBB (int remaining)
 

Protected Attributes

ByteBuffer requestBB
 
SocketChannel sc
 

Package Functions

void close () throws IOException
 
boolean dataFlush () throws IOException
 
boolean doHandshake () throws IOException
 
boolean doHandshake (SelectionKey sk) throws IOException
 
ByteBuffer getReadBuf ()
 
SocketChannel getSocketChannel ()
 
int read () throws IOException
 
boolean shutdown () throws IOException
 
long transferTo (FileChannel fc, long pos, long len) throws IOException
 
int write (ByteBuffer src) throws IOException
 

Static Package Functions

static ChannelIO getInstance (SocketChannel sc, boolean blocking) throws IOException
 

Static Private Attributes

static int requestBBSize = 4096
 

Detailed Description

A helper class for properly sizing inbound byte buffers and redirecting I/O calls to the proper SocketChannel call.

Many of these calls may seem unnecessary until you consider that they are placeholders for the secure variant, which is much more involved. See ChannelIOSecure for more information.

Author
Brad R. Wetmore
Mark Reinhold

Definition at line 56 of file ChannelIO.java.

Constructor & Destructor Documentation

◆ ChannelIO()

ChannelIO.ChannelIO ( SocketChannel  sc,
boolean  blocking 
) throws IOException
protected

Definition at line 68 of file ChannelIO.java.

References sc.

Referenced by getInstance().

Here is the caller graph for this function:

Member Function Documentation

◆ close()

void ChannelIO.close ( ) throws IOException
package

Definition at line 185 of file ChannelIO.java.

References sc.

Referenced by RequestHandler.handle(), and RequestServicer.service().

Here is the caller graph for this function:

◆ dataFlush()

boolean ChannelIO.dataFlush ( ) throws IOException
package

Reimplemented in ChannelIOSecure.

Definition at line 166 of file ChannelIO.java.

◆ doHandshake() [1/2]

boolean ChannelIO.doHandshake ( ) throws IOException
package

Reimplemented in ChannelIOSecure.

Definition at line 108 of file ChannelIO.java.

Referenced by RequestHandler.receive(), and RequestServicer.receive().

Here is the caller graph for this function:

◆ doHandshake() [2/2]

boolean ChannelIO.doHandshake ( SelectionKey  sk) throws IOException
package

Reimplemented in ChannelIOSecure.

Definition at line 121 of file ChannelIO.java.

◆ getInstance()

static ChannelIO ChannelIO.getInstance ( SocketChannel  sc,
boolean  blocking 
) throws IOException
staticpackage

Definition at line 74 of file ChannelIO.java.

References ChannelIO(), requestBB, requestBBSize, and sc.

Referenced by AcceptHandler.handle(), Acceptor.run(), B1.runServer(), BN.runServer(), and BP.runServer().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getReadBuf()

ByteBuffer ChannelIO.getReadBuf ( )
package

Definition at line 140 of file ChannelIO.java.

References requestBB.

Referenced by RequestHandler.receive(), and RequestServicer.receive().

Here is the caller graph for this function:

◆ getSocketChannel()

SocketChannel ChannelIO.getSocketChannel ( )
package

Definition at line 82 of file ChannelIO.java.

References sc.

Referenced by AcceptHandler.handle(), and Acceptor.run().

Here is the caller graph for this function:

◆ read()

int ChannelIO.read ( ) throws IOException
package

Reimplemented in ChannelIOSecure.

Definition at line 129 of file ChannelIO.java.

References requestBB, requestBBSize, resizeRequestBB(), and sc.

Referenced by RequestHandler.receive(), and RequestServicer.receive().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ resizeRequestBB()

void ChannelIO.resizeRequestBB ( int  remaining)
protected

Definition at line 90 of file ChannelIO.java.

References requestBB.

Referenced by read().

Here is the caller graph for this function:

◆ shutdown()

boolean ChannelIO.shutdown ( ) throws IOException
package

Reimplemented in ChannelIOSecure.

Definition at line 178 of file ChannelIO.java.

Referenced by RequestHandler.handle(), and RequestServicer.service().

Here is the caller graph for this function:

◆ transferTo()

long ChannelIO.transferTo ( FileChannel  fc,
long  pos,
long  len 
) throws IOException
package

Reimplemented in ChannelIOSecure.

Definition at line 154 of file ChannelIO.java.

References sc.

◆ write()

int ChannelIO.write ( ByteBuffer  src) throws IOException
package

Reimplemented in ChannelIOSecure.

Definition at line 147 of file ChannelIO.java.

References sc.

Member Data Documentation

◆ requestBB

ByteBuffer ChannelIO.requestBB
protected

◆ requestBBSize

int ChannelIO.requestBBSize = 4096
staticprivate

Definition at line 66 of file ChannelIO.java.

Referenced by getInstance(), and read().

◆ sc

SocketChannel ChannelIO.sc
protected

The documentation for this class was generated from the following file: