edu.rit.mp
Class Channel
- java.lang.Object
-
- edu.rit.mp.Channel
-
public abstract class Channel extends java.lang.ObjectClass Channel provides a channel for sending and receiving messages in the Message Protocol (MP).A channel object is not constructed directly. Rather, a channel group object is used to connect a channel to another computer, accept a channel connection from another computer, or obtain a "loopback" channel within the same computer. See class ChannelGroup for further information.
An information object may be associated with a channel. An application using MP can use the information object to hold additional data about the channel.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method and Description voidclose()Close this channel.voiddump(java.io.PrintStream out, java.lang.String prefix)Dump the state of this channel on the given print stream.abstract java.net.InetSocketAddressfarEndAddress()Obtain this channel's far end address.abstract intfarEndChannelGroupId()Obtain the channel group ID of this channel's far end channel group.ChannelGroupgetChannelGroup()Obtain the channel group that created this channel.java.lang.Objectinfo()Obtain this channel's information object.voidinfo(java.lang.Object theInfo)Set this channel's information object.abstract java.net.InetSocketAddressnearEndAddress()Obtain this channel's near end address.abstract intnearEndChannelGroupId()Obtain the channel group ID of this channel's near end channel group.java.lang.StringtoString()Returns a string version of this channel.
-
-
-
Method Detail
-
getChannelGroup
public ChannelGroup getChannelGroup()
Obtain the channel group that created this channel.- Returns:
- Channel group.
-
nearEndChannelGroupId
public abstract int nearEndChannelGroupId()
Obtain the channel group ID of this channel's near end channel group.- Returns:
- Near end channel group ID.
-
farEndChannelGroupId
public abstract int farEndChannelGroupId()
Obtain the channel group ID of this channel's far end channel group.- Returns:
- Far end channel group ID.
-
nearEndAddress
public abstract java.net.InetSocketAddress nearEndAddress()
Obtain this channel's near end address. This is the host and port of the near end of this channel's connection.- Returns:
- Near end address.
-
farEndAddress
public abstract java.net.InetSocketAddress farEndAddress()
Obtain this channel's far end address. This is the host and port of the far end of this channel's connection.- Returns:
- Far end address.
-
info
public java.lang.Object info()
Obtain this channel's information object.- Returns:
- Information object, or null if none.
-
info
public void info(java.lang.Object theInfo)
Set this channel's information object.- Parameters:
theInfo- Information object, or null if none.
-
close
public void close()
Close this channel. Any pending send requests will fail with a ChannelClosedException.
-
toString
public java.lang.String toString()
Returns a string version of this channel.- Overrides:
toStringin classjava.lang.Object
-
dump
public void dump(java.io.PrintStream out, java.lang.String prefix)Dump the state of this channel on the given print stream. For debugging.- Parameters:
out- Print stream.prefix- String to print at the beginning of each line.
-
-
DMelt 3.0 © DataMelt by jWork.ORG