Package cl.netswitch.lib.channel
The NetSwitch server has two types of devices: Connectors
and
Listeners
. A Connector (or client) connects to a remote
listener, and can have only one bidirectional communication channel (or
socket). A Listener (or server) waits for connections from remote
clients, and can have several bidirectional communication channels, one for
each client.
A ChannelFilter
is an external component.
Each time a Connector or Listener channel is created, a new
instance of a ChannelFilter
is initialized
and bound to the channel. From that point on, every inbound or outbound
Message
is passed to the ChannelFilter
for inspection and possible
modification. Finally, when the channel is closed, the ChannelFilter
instance is terminated and released.
A ChannelCodec
is another type of external
component. Each time a Connector or Listener channel receives
input bytes, it calls the ChannelCodec
to
decode the bytes and produce an inbound Message
. Also, each time a channel writes a Message
, it calls the ChannelCodec
to encode the message into an outbound
sequence of bytes.
- See Also:
-
ClassDescriptionEncodes and decodes messages sent through a communication channel.Decodes a
Message
from an inboundByteBuffer
.Encodes an outboundMessage
into aByteBuffer
.Inspects or modifies inbound and outboundMessages
of a communication channel.Allows aChannelCodec
to communicate with its container.Signals that a encoder/decoder error of some kind has occurred.Allows aChannelFilter
to communicate with its container.Signals that a filter error of some kind has occurred.