C# Class Rsdn.Janus.Framework.Ipc.APipeConnection

An abstract class, which defines the methods for creating named pipes connections, reading and writing data.
This class used for client and server applications respectively, which communicate using NamesPipes.
Inheritance: IInterProcessConnection
Datei anzeigen Open project: rsdn/janus

Protected Properties

Property Type Description
_disposed bool
_handle PipeHandle
_maxReadBytes int
_name string

Public Methods

Method Description
CheckIfDisposed ( ) : void

Checks if the pipe connection is disposed.

This check is done before performing any pipe operations.

Close ( ) : void

Closes the pipe connection.

Connect ( ) : void

Connects a pipe connection.

Dispose ( ) : void

Disposes a pipe connection by closing the underlying native handle.

GetState ( ) : InterProcessConnectionState

object.

Read ( ) : string

Reads a message from the pipe connection and converts it to a string using the UTF8 encoding.

ReadBytes ( ) : byte[]

Reads a message from the pipe connection.

Write ( string text ) : void

Writes a string to the pipe connection/

WriteBytes ( byte bytes ) : void

Writes an array of bytes to the pipe connection.

Protected Methods

Method Description
Dispose ( bool disposing ) : void

Disposes a pipe connection by closing the underlying native handle.

Method Details

CheckIfDisposed() public method

Checks if the pipe connection is disposed.
This check is done before performing any pipe operations.
public CheckIfDisposed ( ) : void
return void

Close() public abstract method

Closes the pipe connection.
public abstract Close ( ) : void
return void

Connect() public abstract method

Connects a pipe connection.
public abstract Connect ( ) : void
return void

Dispose() public method

Disposes a pipe connection by closing the underlying native handle.
public Dispose ( ) : void
return void

Dispose() protected method

Disposes a pipe connection by closing the underlying native handle.
protected Dispose ( bool disposing ) : void
disposing bool A boolean indicating how the method is called.
return void

GetState() public method

object.
public GetState ( ) : InterProcessConnectionState
return InterProcessConnectionState

Read() public method

Reads a message from the pipe connection and converts it to a string using the UTF8 encoding.
public Read ( ) : string
return string

ReadBytes() public method

Reads a message from the pipe connection.
public ReadBytes ( ) : byte[]
return byte[]

Write() public method

Writes a string to the pipe connection/
public Write ( string text ) : void
text string The text to write.
return void

WriteBytes() public method

Writes an array of bytes to the pipe connection.
public WriteBytes ( byte bytes ) : void
bytes byte The bytes array.
return void

Property Details

_disposed protected_oe property

Boolean field used by the IDisposable implementation.
protected bool _disposed
return bool

_handle protected_oe property

A object containing the native pipe handle.
protected PipeHandle,Rsdn.Janus.Framework.Ipc _handle
return PipeHandle

_maxReadBytes protected_oe property

The maximum bytes that will be read from the pipe connection.
This field could be used if the maximum length of the client message is known and we want to implement some security, which prevents the server from reading larger messages.
protected int _maxReadBytes
return int

_name protected_oe property

The name of the named pipe.
This name is used for creating a server pipe and connecting client ones to it.
protected string _name
return string