Package com.caucho.hessian.mux
Class MuxServer
- java.lang.Object
-
- com.caucho.hessian.mux.MuxServer
-
public class MuxServer extends java.lang.ObjectHessian Mux, a peer-to-peer protocol.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Close the muxjava.io.InputStreamgetInputStream()Gets the raw input stream.java.io.OutputStreamgetOutputStream()Gets the raw output stream.voidinit(java.io.InputStream is, java.io.OutputStream os, boolean isClient)Initialize the multiplexor with input and output streams.booleanreadRequest(MuxInputStream in, MuxOutputStream out)Reads a server request.booleanstartCall(int channel, MuxInputStream in, MuxOutputStream out)Starts a client call.booleanstartCall(MuxInputStream in, MuxOutputStream out)Starts a client call.
-
-
-
Constructor Detail
-
MuxServer
public MuxServer()
Null argument constructor.
-
MuxServer
public MuxServer(java.io.InputStream is, java.io.OutputStream os, boolean isClient)Create a new multiplexor with input and output streams.- Parameters:
is- the underlying input streamos- the underlying output streamisClient- true if this is the connection client.
-
-
Method Detail
-
init
public void init(java.io.InputStream is, java.io.OutputStream os, boolean isClient)Initialize the multiplexor with input and output streams.- Parameters:
is- the underlying input streamos- the underlying output streamisClient- true if this is the connection client.
-
getInputStream
public java.io.InputStream getInputStream()
Gets the raw input stream. Clients will normally not call this.
-
getOutputStream
public java.io.OutputStream getOutputStream()
Gets the raw output stream. Clients will normally not call this.
-
startCall
public boolean startCall(MuxInputStream in, MuxOutputStream out) throws java.io.IOException
Starts a client call.- Throws:
java.io.IOException
-
startCall
public boolean startCall(int channel, MuxInputStream in, MuxOutputStream out) throws java.io.IOExceptionStarts a client call.- Throws:
java.io.IOException
-
readRequest
public boolean readRequest(MuxInputStream in, MuxOutputStream out) throws java.io.IOException
Reads a server request.- Throws:
java.io.IOException
-
close
public void close() throws java.io.IOExceptionClose the mux- Throws:
java.io.IOException
-
-