org.vrspace.server
Class BinarySession
java.lang.Object
java.util.Observable
org.vrspace.server.Session
org.vrspace.server.BinarySession
- All Implemented Interfaces:
- java.lang.Runnable
- Direct Known Subclasses:
- GZipSession
- public class BinarySession
- extends Session
A session able to send and read raw bytes.
- See Also:
BinaryConnection
Fields inherited from class org.vrspace.server.Session |
active, cacheRequests, client, daemon, debugLevel, dispatcher, lastTime, lf, preserveSocket, receivedChars, receivedRequests, relogin, RESPONSE_ERR, RESPONSE_NONE, RESPONSE_OK, sentChars, sentRequests, server, socket, startTime, stopTime, TERMINATOR, writer |
Method Summary |
protected void |
close()
End session. |
protected void |
readln()
Reads bytes from the socket and writes them to the OutputStream. |
protected void |
write(byte[] b)
Send b to the client. |
protected void |
write(byte[] b,
int offset,
int len)
Send subset of b to the client. |
Methods inherited from class org.vrspace.server.Session |
debug, flushRequests, getAddress, getId, getSocket, getStatus, isActive, read, run, sendError, sendRequest, sendResponse, terminate, terminate, write |
Methods inherited from class java.util.Observable |
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChanged |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
buffer
protected byte[] buffer
output
protected java.io.OutputStream output
in
protected java.io.InputStream in
out
protected java.io.OutputStream out
filter
protected Filter filter
sentBytes
protected long sentBytes
receivedBytes
protected long receivedBytes
BinarySession
public BinarySession()
BinarySession
public BinarySession(Server server,
java.net.Socket s,
Dispatcher d,
java.io.OutputStream out)
throws java.lang.Exception
- Creates new Session which will write bytes to out
BinarySession
public BinarySession(Server server,
java.net.Socket s,
Dispatcher d,
java.io.OutputStream out,
Filter filter)
throws java.lang.Exception
- Creates new Session which will write bytes to out after filtering
them with filter
readln
protected void readln()
- Reads bytes from the socket and writes them to the OutputStream.
If Filter exists, bytes are filtered using Filter.filter( byte[] ) and
then written to the OutputStream.
- Overrides:
readln
in class Session
- See Also:
Client
write
protected void write(byte[] b)
throws java.io.IOException
- Send b to the client.
- Throws:
java.io.IOException
write
protected void write(byte[] b,
int offset,
int len)
throws java.io.IOException
- Send subset of b to the client.
- Throws:
java.io.IOException
close
protected void close()
- End session.
- Overrides:
close
in class Session