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
Afficher le fichier Open project: rsdn/janus

Protected Properties

Свойство Type Description
_disposed bool
_handle PipeHandle
_maxReadBytes int
_name string

Méthodes publiques

Méthode 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.

Méthodes protégées

Méthode Description
Dispose ( bool disposing ) : void

Disposes a pipe connection by closing the underlying native handle.

Method Details

CheckIfDisposed() public méthode

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

Close() public abstract méthode

Closes the pipe connection.
public abstract Close ( ) : void
Résultat void

Connect() public abstract méthode

Connects a pipe connection.
public abstract Connect ( ) : void
Résultat void

Dispose() public méthode

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

Dispose() protected méthode

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.
Résultat void

GetState() public méthode

object.
public GetState ( ) : InterProcessConnectionState
Résultat InterProcessConnectionState

Read() public méthode

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

ReadBytes() public méthode

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

Write() public méthode

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

WriteBytes() public méthode

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

Property Details

_disposed protected_oe property

Boolean field used by the IDisposable implementation.
protected bool _disposed
Résultat bool

_handle protected_oe property

A object containing the native pipe handle.
protected PipeHandle,Rsdn.Janus.Framework.Ipc _handle
Résultat 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
Résultat 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
Résultat string