|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.gremwell.jnetbridge.Port
public abstract class Port
This class represents an abstract port. Subclasses are expected to do the necessary to obtain received packets and to pass it to ingress() method, which will pass them to the listener. Subclasses have to override send() method and make necessary arrangements to send given packet. Subclasses are expected to increment corresponding counters to provide information about port activity.
Field Summary | |
---|---|
protected PortListener |
listener
|
protected java.lang.String |
name
|
protected int |
received
|
protected int |
sent
|
Method Summary | |
---|---|
abstract void |
close()
The clients have to invoke this method to release resources allocated for this port, if any. |
java.lang.String |
getName()
|
java.lang.String |
getStat()
|
abstract void |
send(org.jnetpcap.nio.JBuffer packet)
Invoked by the clients. |
void |
setListener(PortListener listener)
Set a PortListener the port has to pass ingress packets to. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected final java.lang.String name
protected PortListener listener
protected int received
protected int sent
Method Detail |
---|
public void setListener(PortListener listener)
PortListener
the port has to pass ingress packets to.
listener
- public abstract void close()
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String getName()
public java.lang.String getStat()
public abstract void send(org.jnetpcap.nio.JBuffer packet)
Port
have
to send the packet immediately or enqueue it.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |