Class Client
Implements
Inherited Members
Namespace: VoltRpc.Communication
Assembly: VoltRpc.dll
Syntax
public abstract class Client : IDisposable
Constructors
| Improve this Doc View SourceClient(Int32)
Creates a new Client instance
Declaration
protected Client(int bufferSize = 8000)
Parameters
Type | Name | Description |
---|---|---|
Int32 | bufferSize | The initial size of the buffers |
Exceptions
Type | Condition |
---|---|
ArgumentOutOfRangeException | Will throw if the buffer size is less then 16 |
Fields
| Improve this Doc View SourceDefaultBufferSize
The default size of the buffers
Declaration
public const int DefaultBufferSize = 8000
Field Value
Type | Description |
---|---|
Int32 |
Properties
| Improve this Doc View SourceHasDisposed
Has this object been disposed
Declaration
public bool HasDisposed { get; }
Property Value
Type | Description |
---|---|
Boolean |
IsConnected
Is the Client connected
Declaration
public bool IsConnected { get; }
Property Value
Type | Description |
---|---|
Boolean |
TypeReaderWriterManager
The TypeReaderWriterManager for Client
Declaration
public TypeReaderWriterManager TypeReaderWriterManager { get; }
Property Value
Type | Description |
---|---|
TypeReaderWriterManager |
Methods
| Improve this Doc View SourceAddService(Type)
Tells the Client what interfaces you might be using
Declaration
public void AddService(Type interfaceType)
Parameters
Type | Name | Description |
---|---|---|
Type | interfaceType |
Exceptions
Type | Condition |
---|---|
NullReferenceException | Thrown if interfaceType's FullName is null |
ArgumentOutOfRangeException | Thrown if interfaceType is not an interface, or has already been added as a service. |
AddService<T>()
Tells the Client what interfaces you might be using
Declaration
public void AddService<T>()
where T : class
Type Parameters
Name | Description |
---|---|
T | The same interface that you are using on the server |
Exceptions
Type | Condition |
---|---|
NullReferenceException | Thrown if T's FullName is null |
ArgumentOutOfRangeException | Thrown if T is not an interface, or has already been added as a service. |
CheckDispose()
Checks if the object has been disposed
Declaration
protected void CheckDispose()
Exceptions
Type | Condition |
---|---|
ObjectDisposedException |
Connect()
Connects the Client to a host
Declaration
public abstract void Connect()
Dispose()
Destroys the Client instance
Declaration
public virtual void Dispose()
Finalize()
Deconstructor for Client.
Tells the server that we have disconnected and releases resources if it hasn't been done by Dispose() already.
Declaration
protected void Finalize()
Initialize(Stream, Stream)
Initialize streams
Declaration
protected void Initialize(Stream readStream, Stream writeStream)
Parameters
Type | Name | Description |
---|---|---|
Stream | readStream | The Stream to read from |
Stream | writeStream | The Stream to write to |
Exceptions
Type | Condition |
---|---|
ArgumentNullException | Thrown if either provided stream is null |
ArgumentOutOfRangeException | Thrown if we can't read or write to the respected streams |
Initialize(BufferedReader, BufferedWriter)
Initialize streams
Declaration
protected void Initialize(BufferedReader bufferedRead, BufferedWriter bufferedWrite)
Parameters
Type | Name | Description |
---|---|---|
BufferedReader | bufferedRead | The BufferedReader that will be read from |
BufferedWriter | bufferedWrite | The BufferedWriter that will be written to |
Exceptions
Type | Condition |
---|---|
ArgumentNullException | Thrown if either provided buffers is null |
InvokeMethod(String, Object[])
Invokes a method on the server
Declaration
public object[] InvokeMethod(string methodName, params object[] parameters)
Parameters
Type | Name | Description |
---|---|---|
String | methodName | The full method name |
Object[] | parameters | All parameters to be passed to the method |
Returns
Type | Description |
---|---|
Object[] |
Exceptions
Type | Condition |
---|---|
NotConnectedException | Thrown if the client is not connected to a host |
MissingMethodException | Thrown if the method name doesn't exist on either the client or host |
NoTypeReaderWriterException | Thrown if the return type or parameter types doesn't have a VoltRpc.Types.ITypeReadWriter |
TypeReaderWriterException | Thrown if the type reader/writer fails on the host |
MethodInvokeFailedException | Thrown if an Exception occurs while invoking a method on the host |