Search Results for

    Show / Hide Table of Contents

    Class Client

    The Client sends messages to a Host

    Inheritance
    Object
    Client
    PipesClient
    TCPClient
    Implements
    IDisposable
    Inherited Members
    Object.Equals(Object)
    Object.Equals(Object, Object)
    Object.GetHashCode()
    Object.GetType()
    Object.MemberwiseClone()
    Object.ReferenceEquals(Object, Object)
    Object.ToString()
    Namespace: VoltRpc.Communication
    Assembly: VoltRpc.dll
    Syntax
    public abstract class Client : IDisposable

    Constructors

    | Improve this Doc View Source

    Client(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 Source

    DefaultBufferSize

    The default size of the buffers

    Declaration
    public const int DefaultBufferSize = 8000
    Field Value
    Type Description
    Int32

    Properties

    | Improve this Doc View Source

    HasDisposed

    Has this object been disposed

    Declaration
    public bool HasDisposed { get; }
    Property Value
    Type Description
    Boolean
    | Improve this Doc View Source

    IsConnected

    Is the Client connected

    Declaration
    public bool IsConnected { get; }
    Property Value
    Type Description
    Boolean
    | Improve this Doc View Source

    TypeReaderWriterManager

    The TypeReaderWriterManager for Client

    Declaration
    public TypeReaderWriterManager TypeReaderWriterManager { get; }
    Property Value
    Type Description
    TypeReaderWriterManager

    Methods

    | Improve this Doc View Source

    AddService(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.

    | Improve this Doc View Source

    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.

    | Improve this Doc View Source

    CheckDispose()

    Checks if the object has been disposed

    Declaration
    protected void CheckDispose()
    Exceptions
    Type Condition
    ObjectDisposedException
    | Improve this Doc View Source

    Connect()

    Connects the Client to a host

    Declaration
    public abstract void Connect()
    | Improve this Doc View Source

    Dispose()

    Destroys the Client instance

    Declaration
    public virtual void Dispose()
    | Improve this Doc View Source

    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()
    | Improve this Doc View Source

    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

    | Improve this Doc View Source

    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

    | Improve this Doc View Source

    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

    Implements

    System.IDisposable
    • Improve this Doc
    • View Source
    ☀
    ☾
    In This Article
    Back to top
    Voltstro-Studios (c) 2021-2022
    ☀
    ☾