|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--edu.UCL.xmiddle.controller.UDPListener
UDPListener receives data from a specific host, which is given upon creation of the instance
Listener
Constructor Summary | |
UDPListener(java.net.DatagramSocket socket,
UDPHost host)
Creates a new UDPListener instance. |
Method Summary | |
void |
close()
Closes the datagram socket. |
int |
getSegment()
Returns the maximum size of the data packet we expect |
Data |
rawReceive()
receives a packet without negotitating packet size |
Data |
receive()
Receives a Data packet from the remote host. |
void |
setSegment(int segment)
Sets the maximum size of the data packet we expect |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public UDPListener(java.net.DatagramSocket socket, UDPHost host)
UDPListener
instance.
socket
- The datagram socket from which the data are going
to be receivedhost
- The host from which we expect dataMethod Detail |
public void close()
close
in interface Listener
public int getSegment()
getSegment
in interface Listener
public void setSegment(int segment)
setSegment
in interface Listener
segment
- public Data receive()
Data
packet from the remote host. We
expect that the packet will have a maximum size as given by
setSegment()
receive
in interface Listener
Data
valuepublic Data rawReceive()
Listener
rawReceive
in interface Listener
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |