Add Id to MessageReceived
This commit is contained in:
parent
4fa8af7a54
commit
bd4d33670e
|
@ -38,12 +38,14 @@ namespace Tesses.RPC
|
||||||
public sealed class MessageReceived<T,TType>
|
public sealed class MessageReceived<T,TType>
|
||||||
{
|
{
|
||||||
Action<TType> reply;
|
Action<TType> reply;
|
||||||
internal MessageReceived(T data,bool needReply,Action<TType> reply)
|
internal MessageReceived(T data,bool needReply,long id,Action<TType> reply)
|
||||||
{
|
{
|
||||||
Data = data;
|
Data = data;
|
||||||
NeedReply = needReply;
|
NeedReply = needReply;
|
||||||
this.reply=reply;
|
this.reply=reply;
|
||||||
|
Id = id;
|
||||||
}
|
}
|
||||||
|
public long Id {get;private set;}
|
||||||
public T Data {get;private set;}
|
public T Data {get;private set;}
|
||||||
public bool NeedReply {get;private set;}
|
public bool NeedReply {get;private set;}
|
||||||
public void Reply(TType msg)
|
public void Reply(TType msg)
|
||||||
|
@ -85,7 +87,7 @@ namespace Tesses.RPC
|
||||||
if(recv!=null && msg.MessageState != MessageState.ResponseNoForget)
|
if(recv!=null && msg.MessageState != MessageState.ResponseNoForget)
|
||||||
{
|
{
|
||||||
|
|
||||||
MessageReceived<T,TType> msg0=new MessageReceived<T,TType>(msg.Value.ToObject<T>(),msg.MessageState != MessageState.Forget ,(reply)=>{
|
MessageReceived<T,TType> msg0=new MessageReceived<T,TType>(msg.Value.ToObject<T>(),msg.MessageState != MessageState.Forget ,msg.Id,(reply)=>{
|
||||||
SendMessageResponse(reply,msg.Id);
|
SendMessageResponse(reply,msg.Id);
|
||||||
});
|
});
|
||||||
recv?.Invoke(msg0);
|
recv?.Invoke(msg0);
|
||||||
|
|
|
@ -10,9 +10,9 @@
|
||||||
<PackageId>Tesses.RPC</PackageId>
|
<PackageId>Tesses.RPC</PackageId>
|
||||||
<Author>Mike Nolan</Author>
|
<Author>Mike Nolan</Author>
|
||||||
<Company>Tesses</Company>
|
<Company>Tesses</Company>
|
||||||
<Version>1.0.1</Version>
|
<Version>1.0.2</Version>
|
||||||
<AssemblyVersion>1.0.1</AssemblyVersion>
|
<AssemblyVersion>1.0.2</AssemblyVersion>
|
||||||
<FileVersion>1.0.1</FileVersion>
|
<FileVersion>1.0.2</FileVersion>
|
||||||
<Description>A simple RPC library for .NET</Description>
|
<Description>A simple RPC library for .NET</Description>
|
||||||
<PackageLicenseExpression>GPL-3.0-only</PackageLicenseExpression>
|
<PackageLicenseExpression>GPL-3.0-only</PackageLicenseExpression>
|
||||||
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>
|
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>
|
||||||
|
|
Loading…
Reference in New Issue