C# Класс tiesky.com.SharmIpc

Inter-process communication handler. IPC for .NET https://github.com/hhblaze/SharmIPC or http://sharmipc.tiesky.com
Наследование: IDisposable
Показать файл Открыть проект

Открытые методы

Метод Описание
AsyncAnswerOnRemoteCall ( ulong msgId, byte[]>.Tuple res ) : void

In case if asyncRemoteCallHandler != null

Dispose ( ) : void

RemoteRequest ( byte args, byte[]>.Action callBack = null, int timeoutMs = 30000 ) : byte[]>.Tuple

RemoteRequestWithoutResponse ( byte args ) : bool

Just sends payload to remote partner without awaiting response from it.

SharmIpc ( string uniqueHandlerName, byte[]>.Action remoteCallHandler, long bufferCapacity = 50000, int maxQueueSizeInBytes = 20000000, System.Exception>.Action ExternalExceptionHandler = null ) : System

SharmIpc constructor

SharmIpc ( string uniqueHandlerName, byte[]>.Func remoteCallHandler, long bufferCapacity = 50000, int maxQueueSizeInBytes = 20000000, System.Exception>.Action ExternalExceptionHandler = null ) : System

SharmIpc constructor

Приватные методы

Метод Описание
InternalDataArrived ( eMsgType msgType, ulong msgId, byte bt ) : void

Any incoming data from remote partner is accumulated here

LogException ( string description, System ex ) : void

Internal exception logger

Описание методов

AsyncAnswerOnRemoteCall() публичный Метод

In case if asyncRemoteCallHandler != null
public AsyncAnswerOnRemoteCall ( ulong msgId, byte[]>.Tuple res ) : void
msgId ulong
res byte[]>.Tuple
Результат void

Dispose() публичный Метод

public Dispose ( ) : void
Результат void

RemoteRequest() публичный Метод

public RemoteRequest ( byte args, byte[]>.Action callBack = null, int timeoutMs = 30000 ) : byte[]>.Tuple
args byte payload which must be send to remote partner
callBack byte[]>.Action if specified then response for the request will be returned into callBack (async). Default is sync.
timeoutMs int Default 30 sec
Результат byte[]>.Tuple

RemoteRequestWithoutResponse() публичный Метод

Just sends payload to remote partner without awaiting response from it.
public RemoteRequestWithoutResponse ( byte args ) : bool
args byte payload
Результат bool

SharmIpc() публичный Метод

SharmIpc constructor
public SharmIpc ( string uniqueHandlerName, byte[]>.Action remoteCallHandler, long bufferCapacity = 50000, int maxQueueSizeInBytes = 20000000, System.Exception>.Action ExternalExceptionHandler = null ) : System
uniqueHandlerName string Must be unique in OS scope (can be PID [ID of the process] + other identifications)
remoteCallHandler byte[]>.Action Callback routine for the remote partner requests. AsyncAnswerOnRemoteCall must be used for answer
bufferCapacity long bigger buffer sends larger datablocks faster. Default value is 50000
maxQueueSizeInBytes int If remote partner is temporary not available, messages are accumulated in the sending buffer. This value sets the upper threshold of the buffer in bytes.
ExternalExceptionHandler System.Exception>.Action External exception handler can be supplied, will be returned Description from SharmIPC, like class.method name and handeled exception
Результат System

SharmIpc() публичный Метод

SharmIpc constructor
public SharmIpc ( string uniqueHandlerName, byte[]>.Func remoteCallHandler, long bufferCapacity = 50000, int maxQueueSizeInBytes = 20000000, System.Exception>.Action ExternalExceptionHandler = null ) : System
uniqueHandlerName string Must be unique in OS scope (can be PID [ID of the process] + other identifications)
remoteCallHandler byte[]>.Func Response routine for the remote partner requests
bufferCapacity long bigger buffer sends larger datablocks faster. Default value is 50000
maxQueueSizeInBytes int If remote partner is temporary not available, messages are accumulated in the sending buffer. This value sets the upper threshold of the buffer in bytes.
ExternalExceptionHandler System.Exception>.Action External exception handler can be supplied, will be returned Description from SharmIPC, like class.method name and handeled exception
Результат System