Class SharedConnectionServerImpl
- All Implemented Interfaces:
ConnectionServer
,SharedConnectionServer
- Direct Known Subclasses:
NetSharedConnectionServerImpl
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate AltingConnectionServerImpl
private ConnectionWithSharedAltingServer
private ChannelInput
private ChannelOutput
Fields inherited from interface org.jcsp.lang.ConnectionServer
FACTORY
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
SharedConnectionServerImpl
(AltingChannelInput openIn, AltingChannelInput requestIn, ChannelInput synchIn, SharedChannelOutput synchOut, ConnectionWithSharedAltingServer parent) -
Method Summary
Modifier and TypeMethodDescriptionCreates a duplicate copy of the connection end.void
Sends some data back to the client after a request has been received but keeps the connection open.void
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.request()
Receives a request from a client.
-
Field Details
-
connectionServerToUse
-
synchIn
-
synchOut
-
parent
-
-
Constructor Details
-
Method Details
-
request
Description copied from interface:ConnectionServer
Receives 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:
request
in interfaceConnectionServer
- Returns:
- the
Object
sent by the client.
-
reply
Description copied from interface:ConnectionServer
Sends 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:
reply
in interfaceConnectionServer
- Parameters:
data
- the data to send to the client.
-
reply
Description copied from interface:ConnectionServer
Sends some data back to the client after a request has been received. The
boolean
close parameter indicates whether the connection should be closed after this reply has been sent.This method should not block.
- Specified by:
reply
in interfaceConnectionServer
- Parameters:
data
- the data to send back to client.close
-boolean
that should betrue
iff the connection should be dropped after the reply has been sent.
-
replyAndClose
Description copied from interface:ConnectionServer
Sends 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:
replyAndClose
in interfaceConnectionServer
- Parameters:
data
- the data to send back to client.
-
duplicate
Description copied from interface:SharedConnectionServer
Creates a duplicate copy of the connection end.
- Specified by:
duplicate
in interfaceSharedConnectionServer
- Returns:
- the duplicate
SharedConnectionServer
object.
-