Package com.jme3.network.service.rpc
Class RpcClientService
java.lang.Object
com.jme3.network.service.AbstractService<ClientServiceManager>
com.jme3.network.service.AbstractClientService
com.jme3.network.service.rpc.RpcClientService
- All Implemented Interfaces:
ClientService
,Service<ClientServiceManager>
RPC service that can be added to a network Client to
add RPC send/receive capabilities. Remote procedure
calls can be made to the server and responses retrieved.
Any remote procedure calls that the server performs for
this connection will be received by this service and delegated
to the appropriate RpcHandlers.
-
Constructor Summary
ConstructorDescriptionCreates a new RpcClientService that can be registered with the network Client object. -
Method Summary
Modifier and TypeMethodDescriptioncallAndWait
(byte channel, short objId, short procId, Object... args) Performs a synchronous call on the server against the specified object using the specified procedure ID.void
Performs an asynchronous call on the server against the specified object using the specified procedure ID.Returns the underlying RPC connection for use by other services that may require a more generic non-client/server specific RPC object with which to interact.protected void
onInitialize
(ClientServiceManager serviceManager) Used internally to set up the RpcConnection and MessageDelegator.void
registerHandler
(short objId, RpcHandler handler) Register a handler that will be called when the server performs a remove procedure call against this client.void
removeHandler
(short objId, RpcHandler handler) Removes a previously registered handler for the specified object ID.void
terminate
(ClientServiceManager serviceManager) Used internally to unregister the RPC MessageDelegator that was previously added to the network Client.Methods inherited from class com.jme3.network.service.AbstractClientService
getClient
Methods inherited from class com.jme3.network.service.AbstractService
getService, getServiceManager, initialize, start, stop, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface com.jme3.network.service.ClientService
initialize, start, stop
-
Constructor Details
-
RpcClientService
public RpcClientService()Creates a new RpcClientService that can be registered with the network Client object.
-
-
Method Details
-
getRpcConnection
Returns the underlying RPC connection for use by other services that may require a more generic non-client/server specific RPC object with which to interact. -
onInitialize
Used internally to set up the RpcConnection and MessageDelegator.- Specified by:
onInitialize
in classAbstractService<ClientServiceManager>
-
terminate
Used internally to unregister the RPC MessageDelegator that was previously added to the network Client.- Specified by:
terminate
in interfaceClientService
- Specified by:
terminate
in interfaceService<ClientServiceManager>
- Overrides:
terminate
in classAbstractService<ClientServiceManager>
-
callAndWait
Performs a synchronous call on the server against the specified object using the specified procedure ID. Both inbound and outbound communication is done on the specified channel. -
callAsync
Performs an asynchronous call on the server against the specified object using the specified procedure ID. Communication is done over the specified channel. No responses are received and none are waited for. -
registerHandler
Register a handler that will be called when the server performs a remove procedure call against this client. Only one handler per object ID can be registered at any given time, though the same handler can be registered for multiple object IDs. -
removeHandler
Removes a previously registered handler for the specified object ID.
-