| java.lang.Object org.w3c.www.mux.MuxStream
MuxStream | public class MuxStream (Code) | | |
Method Summary | |
public MuxSession | connect(int protid) Create a new MUX session, by connecting to the other end.
Parameters: protid - The protocol that is going to be spoken on that new session. | protected void | ctrlDefineStack(int id, int stack) Handle the given DefineStack control message. | protected void | ctrlDefineString(int strid, String str) Handle the given DefineString control message. | protected void | ctrlMuxControl(int sessid, int fragsz) Handle the given MuxControl control message. | protected void | ctrlSendCredit(int sessid, int credit) Handle the given SendCredit control message. | protected void | error(Object obj, Exception ex) A severe (fatal for that connection) errror has occured. | protected synchronized void | error(Object obj, String msg) A soft error has occured (eg socket close), Cleanup. | public InetAddress | getInetAddress() Get the InetAddress associated with that MUX stream, if any.
MUX streams can run on any kind of Input/Output streams. | final protected MuxWriter | getMuxWriter() Get this stream MuxWriter object. | protected MuxSession | lookupSession(int flags, int sessid, int length, int llength) Handle that new incomming message. | protected synchronized MuxSession | lookupSession(int sessid, boolean check) Lookup for an already existing session having the given identifier.
Parameters: sessid - The identifier of the session to look for. Parameters: check - Is null a valid answer, if set andthe requested session doesn't exist, a runtime exception is thrown. | public synchronized boolean | shutdown(boolean force) Shutdown this stream, and associated sessions gracefully.
Parameters: force - If true abort all existing sessions, andclose the muxed streams physically. | protected synchronized void | unregisterSession(MuxSession session) Unregiter the given session, it has been closed. |
alive | protected boolean alive(Code) | | Is this muxed stream still alive ?
|
inetaddr | protected InetAddress inetaddr(Code) | | Inet address of the other end's connection (maybe null)
|
server | protected boolean server(Code) | | Is this the server side of the MUX channel ?
|
connect | public MuxSession connect(int protid) throws IOException(Code) | | Create a new MUX session, by connecting to the other end.
Parameters: protid - The protocol that is going to be spoken on that new session. A connected MuxSession. exception: IOException - If the connection couldn't be set up properly. |
ctrlDefineStack | protected void ctrlDefineStack(int id, int stack) throws IOException(Code) | | Handle the given DefineStack control message.
Parameters: id - The identifier for that stack in the future. Parameters: stack - The stack description (as an array of shorts). |
ctrlDefineString | protected void ctrlDefineString(int strid, String str)(Code) | | Handle the given DefineString control message.
Parameters: strid - The identifier for that String in the futur. Parameters: str - This String being defined. |
ctrlMuxControl | protected void ctrlMuxControl(int sessid, int fragsz) throws IOException(Code) | | Handle the given MuxControl control message.
Parameters: sessid - The session to which that message applies. Parameters: fragsz - The max allowed fragment size on that session. |
ctrlSendCredit | protected void ctrlSendCredit(int sessid, int credit) throws IOException(Code) | | Handle the given SendCredit control message.
Parameters: sessid - The session to which that message applies. Parameters: credit - The allowed credits. |
error | protected void error(Object obj, Exception ex)(Code) | | A severe (fatal for that connection) errror has occured. Cleanup.
Parameters: obj - The object that has generated the error. Parameters: ex - The exception that triggered the error (or null null if this was a logical error). |
error | protected synchronized void error(Object obj, String msg)(Code) | | A soft error has occured (eg socket close), Cleanup.
Parameters: obj - The object that has detected the soft error. Parameters: msg - An associated String message. |
getInetAddress | public InetAddress getInetAddress()(Code) | | Get the InetAddress associated with that MUX stream, if any.
MUX streams can run on any kind of Input/Output streams. This method
will only return a non-null instance when possible.
An InetAddress instance, or null if notavailable. |
getMuxWriter | final protected MuxWriter getMuxWriter()(Code) | | Get this stream MuxWriter object.
A MuxWriter instance. |
lookupSession | protected MuxSession lookupSession(int flags, int sessid, int length, int llength) throws IOException(Code) | | Handle that new incomming message.
This method is called by the reader of that session, to dispatch
the message currently being read.
A MuxSession instance to dispatch that message to, ornull otherwise (ie a new session was rejected, etc).In that last case, it is up to the reader of that session to discard any pending data. |
lookupSession | protected synchronized MuxSession lookupSession(int sessid, boolean check)(Code) | | Lookup for an already existing session having the given identifier.
Parameters: sessid - The identifier of the session to look for. Parameters: check - Is null a valid answer, if set andthe requested session doesn't exist, a runtime exception is thrown. A MuxSession instance, or null if check isfalse and no session was found. |
shutdown | public synchronized boolean shutdown(boolean force) throws IOException(Code) | | Shutdown this stream, and associated sessions gracefully.
Parameters: force - If true abort all existing sessions, andclose the muxed streams physically. Otherwise, shutdown the muxed streamgracefully only if no more sessions are running. A boolean, true if shutdown was performed,false if it was not performed because forcewas false and some sessions were still running. exception: IOException - If some IO error occured. |
unregisterSession | protected synchronized void unregisterSession(MuxSession session)(Code) | | Unregiter the given session, it has been closed.
Parameters: session - The session to unregister. |
|
|