Package com.caucho.hessian.mux
Class MuxServer
- java.lang.Object
-
- com.caucho.hessian.mux.MuxServer
-
public class MuxServer extends Object
Hessian Mux, a peer-to-peer protocol.
-
-
Constructor Summary
Constructors Constructor Description MuxServer()Null argument constructor.MuxServer(InputStream is, OutputStream os, boolean isClient)Create a new multiplexor with input and output streams.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Close the muxInputStreamgetInputStream()Gets the raw input stream.OutputStreamgetOutputStream()Gets the raw output stream.voidinit(InputStream is, 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(InputStream is, 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(InputStream is, 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 InputStream getInputStream()
Gets the raw input stream. Clients will normally not call this.
-
getOutputStream
public OutputStream getOutputStream()
Gets the raw output stream. Clients will normally not call this.
-
startCall
public boolean startCall(MuxInputStream in, MuxOutputStream out) throws IOException
Starts a client call.- Throws:
IOException
-
startCall
public boolean startCall(int channel, MuxInputStream in, MuxOutputStream out) throws IOExceptionStarts a client call.- Throws:
IOException
-
readRequest
public boolean readRequest(MuxInputStream in, MuxOutputStream out) throws IOException
Reads a server request.- Throws:
IOException
-
close
public void close() throws IOExceptionClose the mux- Throws:
IOException
-
-