public class AltingConnectionServerImpl extends AltingConnectionServer
Modifier and Type | Field and Description |
---|---|
protected static int |
SERVER_STATE_CLOSED
Server state.
|
protected static int |
SERVER_STATE_OPEN
Server state.
|
protected static int |
SERVER_STATE_RECEIVED
Server state.
|
FACTORY
Modifier | Constructor and Description |
---|---|
protected |
AltingConnectionServerImpl(AltingChannelInput openIn,
AltingChannelInput furtherRequestIn)
Constructs a new server instance.
|
Modifier and Type | Method and Description |
---|---|
protected int |
getServerState() |
void |
reply(Object data)
Sends some data back to the client after a request
has been received but keeps the connection open.
|
void |
reply(Object data,
boolean close)
Sends some data back to the client after a request
has been received.
|
void |
replyAndClose(Object data)
Sends some data back to the client and closes the connection.
|
Object |
request()
Receives some data from a client once a connection
has been established.
|
getAltingChannel, pending, setAltingChannel
protected static final int SERVER_STATE_CLOSED
protected static final int SERVER_STATE_OPEN
protected static final int SERVER_STATE_RECEIVED
protected AltingConnectionServerImpl(AltingChannelInput openIn, AltingChannelInput furtherRequestIn)
public Object request() throws IllegalStateException
request(Object)
but by establishing
a connection.Object
sent by the client.IllegalStateException
public void reply(Object data) throws IllegalStateException
recieve()
to receive a further request.data
- the data to send to the client.IllegalStateException
public void reply(Object data, boolean close) throws IllegalStateException
true
.data
- the data to send to the client.close
- boolean
indicating whether or not the
connection should be closed.IllegalStateException
public void replyAndClose(Object data) throws IllegalStateException
accept()
in order to allow another
connection to this server to be established.
If this method did not take any data to send back to the client,
and the server was meant to call reply(Object)
followed
by a close()
, then there would be a race hazard at the
client as it would not know whether the connection had
remained open or not.data
- the data to send back to client.IllegalStateException
protected int getServerState()
Submit a bug or feature to jcsp-team@kent.ac.uk
Version 1.1-rc4 of the JCSP API Specification (Copyright 1997-2008 P.D.Austin and P.H.Welch - All Rights Reserved)
Java is a trademark or registered trademark of Sun Microsystems, Inc. in the US and other countries.