|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--org.w3c.www.mux.MuxStream
| Field Summary | |
protected boolean |
alive
Is this muxed stream still alive ? |
protected MuxStreamHandler |
handler
That stream accept handler. |
protected java.io.InputStream |
in
The raw input stream. |
protected java.net.InetAddress |
inetaddr
Inet address of the other end's connection (maybe null) |
protected java.io.OutputStream |
out
The raw output stream. |
protected org.w3c.www.mux.MuxReader |
reader
This stream reader. |
protected boolean |
server
Is this the server side of the MUX channel ? |
protected MuxSession[] |
sessions
Currently defined sessions. |
protected org.w3c.www.mux.MuxWriter |
writer
This stream writer. |
| Constructor Summary | |
MuxStream(boolean server,
MuxStreamHandler handler,
java.io.InputStream in,
java.io.OutputStream out)
|
|
MuxStream(boolean server,
MuxStreamHandler handler,
java.net.Socket socket)
|
|
| Method Summary | |
MuxSession |
connect(int protid)
Create a new MUX session, by connecting to the other end. |
protected void |
ctrlDefineStack(int id,
int[] stack)
Handle the given DefineStack control message. |
protected void |
ctrlDefineString(int strid,
java.lang.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(java.lang.Object obj,
java.lang.Exception ex)
A severe (fatal for that connection) errror has occured. |
protected void |
error(java.lang.Object obj,
java.lang.String msg)
A soft error has occured (eg socket close), Cleanup. |
java.net.InetAddress |
getInetAddress()
Get the InetAddress associated with that MUX stream, if any. |
protected org.w3c.www.mux.MuxWriter |
getMuxWriter()
Get this stream MuxWriter object. |
protected MuxSession |
lookupSession(int sessid,
boolean check)
Lookup for an already existing session having the given identifier. |
protected MuxSession |
lookupSession(int flags,
int sessid,
int length,
int llength)
Handle that new incomming message. |
boolean |
shutdown(boolean force)
Shutdown this stream, and associated sessions gracefully. |
protected void |
unregisterSession(MuxSession session)
Unregiter the given session, it has been closed. |
| Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
| Field Detail |
protected MuxStreamHandler handler
protected org.w3c.www.mux.MuxReader reader
protected org.w3c.www.mux.MuxWriter writer
protected MuxSession[] sessions
protected boolean server
protected java.net.InetAddress inetaddr
protected java.io.InputStream in
protected java.io.OutputStream out
protected boolean alive
| Constructor Detail |
public MuxStream(boolean server,
MuxStreamHandler handler,
java.io.InputStream in,
java.io.OutputStream out)
throws java.io.IOException
public MuxStream(boolean server,
MuxStreamHandler handler,
java.net.Socket socket)
throws java.io.IOException
| Method Detail |
protected final org.w3c.www.mux.MuxWriter getMuxWriter()
protected void error(java.lang.Object obj,
java.lang.Exception ex)
obj - The object that has generated the error.ex - The exception that triggered the error (or null
null if this was a logical error).
protected void error(java.lang.Object obj,
java.lang.String msg)
obj - The object that has detected the soft error.msg - An associated String message.
protected void ctrlDefineString(int strid,
java.lang.String str)
strid - The identifier for that String in the futur.str - This String being defined.
protected void ctrlDefineStack(int id,
int[] stack)
throws java.io.IOException
id - The identifier for that stack in the future.stack - The stack description (as an array of shorts).
protected void ctrlMuxControl(int sessid,
int fragsz)
throws java.io.IOException
sessid - The session to which that message applies.fragsz - The max allowed fragment size on that session.
protected void ctrlSendCredit(int sessid,
int credit)
throws java.io.IOException
sessid - The session to which that message applies.credit - The allowed credits.
protected MuxSession lookupSession(int flags,
int sessid,
int length,
int llength)
throws java.io.IOException
protected MuxSession lookupSession(int sessid,
boolean check)
sessid - The identifier of the session to look for.check - Is null a valid answer, if set and
the requested session doesn't exist, a runtime exception is thrown.protected void unregisterSession(MuxSession session)
session - The session to unregister.
public MuxSession connect(int protid)
throws java.io.IOException
protid - The protocol that is going to be spoken on that new
session.public java.net.InetAddress getInetAddress()
public boolean shutdown(boolean force)
throws java.io.IOException
force - If true abort all existing sessions, and
close the muxed streams physically. Otherwise, shutdown the muxed stream
gracefully only if no more sessions are running.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||