本文整理汇总了C#中IClientMessage类的典型用法代码示例。如果您正苦于以下问题:C# IClientMessage类的具体用法?C# IClientMessage怎么用?C# IClientMessage使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IClientMessage类属于命名空间,在下文中一共展示了IClientMessage类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ClientListenerInvocation
public ClientListenerInvocation(IClientMessage message, DistributedEventHandler handler,
DecodeStartListenerResponse responseDecoder, string memberUuid)
: base(message, memberUuid)
{
_responseDecoder = responseDecoder;
_handler = handler;
}
示例2: DecodeResponse
public static ResponseParameters DecodeResponse(IClientMessage clientMessage)
{
ResponseParameters parameters = new ResponseParameters();
byte status;
status = clientMessage.GetByte();
parameters.status = status;
Address address = null;
bool address_isNull = clientMessage.GetBoolean();
if (!address_isNull)
{
address = AddressCodec.Decode(clientMessage);
parameters.address = address;
}
string uuid = null;
bool uuid_isNull = clientMessage.GetBoolean();
if (!uuid_isNull)
{
uuid = clientMessage.GetStringUtf8();
parameters.uuid = uuid;
}
string ownerUuid = null;
bool ownerUuid_isNull = clientMessage.GetBoolean();
if (!ownerUuid_isNull)
{
ownerUuid = clientMessage.GetStringUtf8();
parameters.ownerUuid = ownerUuid;
}
byte serializationVersion;
serializationVersion = clientMessage.GetByte();
parameters.serializationVersion = serializationVersion;
return parameters;
}
示例3: InvokeOnKeyOwner
public override IFuture<IClientMessage> InvokeOnKeyOwner(IClientMessage request, object key)
{
var partitionService = (ClientPartitionService) Client.GetClientPartitionService();
var partitionId = partitionService.GetPartitionId(key);
var owner = partitionService.GetPartitionOwner(partitionId);
return Invoke(new ClientInvocation(request, partitionId), owner);
}
示例4: StartListening
public string StartListening(IClientMessage request, DistributedEventHandler handler,
DecodeStartListenerResponse responseDecoder, object key = null)
{
try
{
IFuture<IClientMessage> task;
if (key == null)
{
task = _client.GetInvocationService()
.InvokeListenerOnRandomTarget(request, handler, responseDecoder);
}
else
{
task = _client.GetInvocationService()
.InvokeListenerOnKeyOwner(request, key, handler, responseDecoder);
}
var clientMessage = ThreadUtil.GetResult(task);
var registrationId = responseDecoder(clientMessage);
RegisterListener(registrationId, request.GetCorrelationId());
return registrationId;
}
catch (Exception e)
{
throw ExceptionUtil.Rethrow(e);
}
}
示例5: DecodeResponse
public static ResponseParameters DecodeResponse(IClientMessage clientMessage)
{
ResponseParameters parameters = new ResponseParameters();
bool response ;
response = clientMessage.GetBoolean();
parameters.response = response;
return parameters;
}
示例6: DecodeResponse
public static ResponseParameters DecodeResponse(IClientMessage clientMessage)
{
var parameters = new ResponseParameters();
long response;
response = clientMessage.GetLong();
parameters.response = response;
return parameters;
}
示例7: DecodeResponse
public static ResponseParameters DecodeResponse(IClientMessage clientMessage)
{
ResponseParameters parameters = new ResponseParameters();
string response = null;
response = clientMessage.GetStringUtf8();
parameters.response = response;
return parameters;
}
示例8: InvokeListenerOnPartition
public override IFuture<IClientMessage> InvokeListenerOnPartition(IClientMessage request, int partitionId,
DistributedEventHandler handler,
DecodeStartListenerResponse responseDecoder)
{
var partitionService = (ClientPartitionService) Client.GetClientPartitionService();
var owner = partitionService.GetPartitionOwner(partitionId);
return Invoke(new ClientListenerInvocation(request, handler, responseDecoder, partitionId), owner);
}
示例9: InvokeListenerOnKeyOwner
public override IFuture<IClientMessage> InvokeListenerOnKeyOwner(IClientMessage request, object key, DistributedEventHandler handler,
DecodeStartListenerResponse responseDecoder)
{
var partitionService = (ClientPartitionService)Client.GetClientPartitionService();
var partitionId = partitionService.GetPartitionId(key);
return SendToOwner(new ClientListenerInvocation(request, handler, responseDecoder, partitionId));
}
示例10: DecodeResponse
public static ResponseParameters DecodeResponse(IClientMessage clientMessage)
{
var parameters = new ResponseParameters();
SimpleEntryView<IData, IData> dataEntryView = null;
var dataEntryView_isNull = clientMessage.GetBoolean();
if (!dataEntryView_isNull)
{
dataEntryView = EntryViewCodec.Decode(clientMessage);
parameters.dataEntryView = dataEntryView;
}
return parameters;
}
示例11: DecodeResponse
public static ResponseParameters DecodeResponse(IClientMessage clientMessage)
{
var parameters = new ResponseParameters();
IData response = null;
var response_isNull = clientMessage.GetBoolean();
if (!response_isNull)
{
response = clientMessage.GetData();
parameters.response = response;
}
return parameters;
}
示例12: Decode
public static Address Decode(IClientMessage clientMessage)
{
var host = clientMessage.GetStringUtf8();
var port = clientMessage.GetInt();
try
{
return new Address(host, port);
}
catch (SocketException)
{
return null;
}
}
示例13: Decode
public static StackTraceElement Decode(IClientMessage clientMessage)
{
var declaringClass = clientMessage.GetStringUtf8();
var methodName = clientMessage.GetStringUtf8();
var fileName_notNull = clientMessage.GetBoolean();
string fileName = null;
if (fileName_notNull)
{
fileName = clientMessage.GetStringUtf8();
}
var lineNumber = clientMessage.GetInt();
return new StackTraceElement(declaringClass, methodName, fileName, lineNumber);
}
示例14: DecodeResponse
public static ResponseParameters DecodeResponse(IClientMessage clientMessage)
{
ResponseParameters parameters = new ResponseParameters();
IList<IData> list = null;
int list_size = clientMessage.GetInt();
list = new List<IData>();
for (int list_index = 0; list_index<list_size; list_index++) {
IData list_item;
list_item = clientMessage.GetData();
list.Add(list_item);
}
parameters.list = list;
return parameters;
}
示例15: DecodeResponse
public static ResponseParameters DecodeResponse(IClientMessage clientMessage)
{
ResponseParameters parameters = new ResponseParameters();
ISet<KeyValuePair<IData,IData>> entrySet = null;
int entrySet_size = clientMessage.GetInt();
entrySet = new HashSet<KeyValuePair<IData,IData>>();
for (int entrySet_index = 0; entrySet_index<entrySet_size; entrySet_index++) {
KeyValuePair<IData,IData> entrySet_item;
entrySet_item = clientMessage.GetMapEntry();
entrySet.Add(entrySet_item);
}
parameters.entrySet = entrySet;
return parameters;
}