InputMultiplexor
is one of the key Multiplex classes, responsible for demultiplexing multiple byte streams sharing a single TCP connection. It has two inner classes which can perform this function.
MultiGroupInputThread
can perform demultiplexing for any number of NIO sockets, taking advantage of the
Selector
facility. For non-NIO sockets, notably SSL sockets,
SingleGroupInputThread
handles demultiplexing for a single socket.
The data stream, created at the other end of the TCP connection by the OutputMultiplexor
class, consists of a sequence of packets, each consisting of a header, giving version, destination virtual socket, and number of bytes. followed by the specified number of data bytes. (See OutputMultiplexor
for the header format. Each of the demultiplexing thread classes reads a header and transfers the following bytes to the input stream of the target virtual socket.
Copyright (c) 2005
@author Ron Sigal