C# Class ShootManiaXMLRPC.XmlRpc.XmlRpcClient

Show file Open project: JuJuBoSc/SMAdminTools Class Usage Examples

Public Methods

Method Description
AsyncRequest ( string inMethodName, object inParams, GbxCallCallbackHandler callbackHandler ) : int

Sends a Request and does not wait for a response of the server. The response will be written into a buffer or you can set a callback method that will be executed.

Connect ( ) : int

Creates a connection to the server.

Disconnect ( ) : void

Closes the socket connection.

Dispose ( ) : void

Frees all resources and disconnects from the rpc server.

EnableCallbacks ( bool inState ) : bool

(Dis)activates callbacks from the server.

GetResponse ( int inHandle ) : GbxCall

Gets an asynchron response from the list.

Request ( string inMethodName, object inParams ) : GbxCall

Sends a request to the server and blocks until a response has been received.

XmlRpcClient ( string inAddress, int inPort ) : System

Initializes the client with port and ip address. Use Connect method to set up a connection.

Private Methods

Method Description
Handshake ( ) : bool

Reads the header of the protocol and checks if for compability.

OnDataArrive ( IAsyncResult iar ) : void
OnDisconnectCallback ( ) : void
OnGbxCallback ( GbxCallbackEventArgs e ) : void
SocketConnect ( string inAddress, int inPort ) : bool

Establishes a socket connection.

Method Details

AsyncRequest() public method

Sends a Request and does not wait for a response of the server. The response will be written into a buffer or you can set a callback method that will be executed.
public AsyncRequest ( string inMethodName, object inParams, GbxCallCallbackHandler callbackHandler ) : int
inMethodName string The method to call.
inParams object Parameters describing your request.
callbackHandler GbxCallCallbackHandler An optional delegate which is callen when the response is available otherwise set it to null.
return int

Connect() public method

Creates a connection to the server.
public Connect ( ) : int
return int

Disconnect() public method

Closes the socket connection.
public Disconnect ( ) : void
return void

Dispose() public method

Frees all resources and disconnects from the rpc server.
public Dispose ( ) : void
return void

EnableCallbacks() public method

(Dis)activates callbacks from the server.
public EnableCallbacks ( bool inState ) : bool
inState bool Whether to receive callbacks from the server.
return bool

GetResponse() public method

Gets an asynchron response from the list.
public GetResponse ( int inHandle ) : GbxCall
inHandle int The handle which was returned from AsyncRequest.
return GbxCall

Request() public method

Sends a request to the server and blocks until a response has been received.
public Request ( string inMethodName, object inParams ) : GbxCall
inMethodName string The method to call.
inParams object Parameters describing your request.
return GbxCall

XmlRpcClient() public method

Initializes the client with port and ip address. Use Connect method to set up a connection.
public XmlRpcClient ( string inAddress, int inPort ) : System
inAddress string IP address to initialize with.
inPort int Port to initialize the client with.
return System