org.lastbamboo.common.p2p
Interface RawUdpServerDepot

All Superinterfaces:
org.littleshoot.util.SessionSocketListener
All Known Implementing Classes:
DefaultRawUdpServerDepot

public interface RawUdpServerDepot
extends org.littleshoot.util.SessionSocketListener

Interface for accessing sessions/sockets in the class for keeping track of such things.


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.
 long read(String id, OutputStream outputStream, int length)
           
 org.json.simple.JSONObject toJson()
           
 void write(String id, byte[] data)
           
 long write(String id, InputStream is, long contentLength)
           
 
Methods inherited from interface org.littleshoot.util.SessionSocketListener
onSocket, reconnected
 

Method Detail

getSocket

Socket getSocket(String id)
Accessor for the Socket with the specified ID.

Parameters:
id - The ID of the socket we're looking for.
Returns:
The Socket.

getIds

Collection<String> getIds()
Get all IDs of current sessions.

Returns:
All IDs of current sessions.

addSocket

void addSocket(String id,
               Socket sock)
Adds the specified socket to the depot.

Parameters:
id - The ID for the socket.
sock - The Socket to add.

addError

void addError(String id,
              String msg)
Adds an error.

Parameters:
id - The ID for the session.
msg - The error message.

toJson

org.json.simple.JSONObject toJson()

write

long write(String id,
           InputStream is,
           long contentLength)
           throws IOException
Throws:
IOException

write

void write(String id,
           byte[] data)
           throws IOException
Throws:
IOException

read

long read(String id,
          OutputStream outputStream,
          int length)
          throws IOException
Throws:
IOException


Copyright © 2013 LittleShoot. All Rights Reserved.