|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.lastbamboo.common.p2p.DefaultRawUdpServerDepot
public class DefaultRawUdpServerDepot
This class accepts incoming, typically relayed raw UDP data connections.
| Constructor Summary | |
|---|---|
DefaultRawUdpServerDepot()
|
|
| Method Summary | |
|---|---|
void |
addError(String id,
String msg)
Adds an error. |
void |
addSocket(String id,
Socket sock)
Adds the specified socket to the depot. |
Collection<String> |
getIds()
Get all IDs of current sessions. |
Socket |
getSocket(String id)
Accessor for the Socket with the specified ID. |
void |
onSocket(String id,
Socket sock)
|
long |
read(String id,
OutputStream outputStream,
int length)
|
void |
reconnected()
|
org.json.simple.JSONObject |
toJson()
|
void |
write(String id,
byte[] data)
|
long |
write(String id,
InputStream is,
long contentLength)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public DefaultRawUdpServerDepot()
| Method Detail |
|---|
public void onSocket(String id,
Socket sock)
throws IOException
onSocket in interface org.littleshoot.util.SessionSocketListenerIOException
public void addSocket(String id,
Socket sock)
RawUdpServerDepot
addSocket in interface RawUdpServerDepotid - The ID for the socket.sock - The Socket to add.public Socket getSocket(String id)
RawUdpServerDepotSocket with the specified ID.
getSocket in interface RawUdpServerDepotid - The ID of the socket we're looking for.
Socket.public Collection<String> getIds()
RawUdpServerDepot
getIds in interface RawUdpServerDepot
public void addError(String id,
String msg)
RawUdpServerDepot
addError in interface RawUdpServerDepotid - The ID for the session.msg - The error message.
public long write(String id,
InputStream is,
long contentLength)
throws IOException
write in interface RawUdpServerDepotIOException
public void write(String id,
byte[] data)
throws IOException
write in interface RawUdpServerDepotIOException
public long read(String id,
OutputStream outputStream,
int length)
throws IOException
read in interface RawUdpServerDepotIOExceptionpublic org.json.simple.JSONObject toJson()
toJson in interface RawUdpServerDepotpublic void reconnected()
reconnected in interface org.littleshoot.util.SessionSocketListener
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||