C# Class tiesky.com.SharmIpc

Inter-process communication handler. IPC for .NET https://github.com/hhblaze/SharmIPC or http://sharmipc.tiesky.com
Inheritance: IDisposable
ファイルを表示 Open project: hhblaze/SharmIPC

Public Methods

Method Description
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

Private Methods

Method Description
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

Method Details

AsyncAnswerOnRemoteCall() public method

In case if asyncRemoteCallHandler != null
public AsyncAnswerOnRemoteCall ( ulong msgId, byte[]>.Tuple res ) : void
msgId ulong
res byte[]>.Tuple
return void

Dispose() public method

public Dispose ( ) : void
return void

RemoteRequest() public method

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
return byte[]>.Tuple

RemoteRequestWithoutResponse() public method

Just sends payload to remote partner without awaiting response from it.
public RemoteRequestWithoutResponse ( byte args ) : bool
args byte payload
return bool

SharmIpc() public method

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
return System

SharmIpc() public method

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
return System