Class NetAltingConnectionServer
- All Implemented Interfaces:
ConnectionServer,NetConnectionServer,Networked
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final ConnectionDataprivate final NetworkMessageFilter.FilterRxprivate final NetworkMessageprivate final Linkprivate final NetConnectionLocationprivate final AltingChannelInputprivate final NetworkMessageFilter.FilterTxprivate final AltingChannelInputFields inherited from interface org.jcsp.lang.ConnectionServer
FACTORY -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateNetAltingConnectionServer(AltingChannelInput openChan, AltingChannelInput requestChan, ConnectionData connData, NetworkMessageFilter.FilterRx filterRX, NetworkMessageFilter.FilterTx filterTX) -
Method Summary
Modifier and TypeMethodDescription(package private) static NetAltingConnectionServercreate(int index, NetworkMessageFilter.FilterRx filterRX, NetworkMessageFilter.FilterTx filterTX) (package private) static NetAltingConnectionServercreate(NetworkMessageFilter.FilterRx filterRX, NetworkMessageFilter.FilterTx filterTX) voiddestroy()Destroys the Networked constructGets the networked location of the Networked constructvoidSends some data back to the client after a request has been received but keeps the connection open.voidSends some data back to the client after a request has been received.voidreplyAndClose(Object data) Sends some data back to the client and closes the connection.request()Receives a request from a client.Methods inherited from class org.jcsp.lang.AltingConnectionServer
getAltingChannel, pending, setAltingChannel
-
Field Details
-
requestIn
-
openIn
-
location
-
inputFilter
-
outputFilter
-
data
-
lastRead
-
linkConnectedTo
-
-
Constructor Details
-
NetAltingConnectionServer
private NetAltingConnectionServer(AltingChannelInput openChan, AltingChannelInput requestChan, ConnectionData connData, NetworkMessageFilter.FilterRx filterRX, NetworkMessageFilter.FilterTx filterTX) throws JCSPNetworkException - Throws:
JCSPNetworkException
-
-
Method Details
-
create
static NetAltingConnectionServer create(int index, NetworkMessageFilter.FilterRx filterRX, NetworkMessageFilter.FilterTx filterTX) throws IllegalArgumentException - Throws:
IllegalArgumentException
-
create
static NetAltingConnectionServer create(NetworkMessageFilter.FilterRx filterRX, NetworkMessageFilter.FilterTx filterTX) -
destroy
public void destroy()Description copied from interface:NetworkedDestroys the Networked construct -
getLocation
Description copied from interface:NetworkedGets the networked location of the Networked construct- Specified by:
getLocationin interfaceNetworked- Returns:
- The location of the construct
-
reply
Description copied from interface:ConnectionServerSends some data back to the client after a request has been received. The
booleanclose parameter indicates whether the connection should be closed after this reply has been sent.This method should not block.
- Specified by:
replyin interfaceConnectionServer- Parameters:
data- the data to send back to client.close-booleanthat should betrueiff the connection should be dropped after the reply has been sent.- Throws:
IllegalStateException
-
reply
Description copied from interface:ConnectionServerSends some data back to the client after a request has been received but keeps the connection open. After calling this method, the server should call
recieve()to receive a further request.A call to this method is equivalent to a call to
reply(Object, boolean)with the boolean set tofalse.- Specified by:
replyin interfaceConnectionServer- Parameters:
data- the data to send to the client.- Throws:
IllegalStateException
-
replyAndClose
Description copied from interface:ConnectionServerSends some data back to the client and closes the connection.
A call to this method is equivalent to a call to
reply(Object, boolean)with the boolean set totrue.- Specified by:
replyAndClosein interfaceConnectionServer- Parameters:
data- the data to send back to client.- Throws:
IllegalStateException
-
request
Description copied from interface:ConnectionServerReceives a request from a client. This will block until the client calls its
request(Object)method. Implementations may make this ALTable.After this method has returned, the server should call one of the reply methods. Performing any external process synchronization between these method calls could be potentially hazardous and could lead to deadlock.
- Specified by:
requestin interfaceConnectionServer- Returns:
- the
Objectsent by the client. - Throws:
IllegalStateException
-