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>
|
||||
{
|
||||
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;
|
||||
NeedReply = needReply;
|
||||
this.reply=reply;
|
||||
Id = id;
|
||||
}
|
||||
public long Id {get;private set;}
|
||||
public T Data {get;private set;}
|
||||
public bool NeedReply {get;private set;}
|
||||
public void Reply(TType msg)
|
||||
|
@ -85,7 +87,7 @@ namespace Tesses.RPC
|
|||
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);
|
||||
});
|
||||
recv?.Invoke(msg0);
|
||||
|
|
|
@ -10,9 +10,9 @@
|
|||
<PackageId>Tesses.RPC</PackageId>
|
||||
<Author>Mike Nolan</Author>
|
||||
<Company>Tesses</Company>
|
||||
<Version>1.0.1</Version>
|
||||
<AssemblyVersion>1.0.1</AssemblyVersion>
|
||||
<FileVersion>1.0.1</FileVersion>
|
||||
<Version>1.0.2</Version>
|
||||
<AssemblyVersion>1.0.2</AssemblyVersion>
|
||||
<FileVersion>1.0.2</FileVersion>
|
||||
<Description>A simple RPC library for .NET</Description>
|
||||
<PackageLicenseExpression>GPL-3.0-only</PackageLicenseExpression>
|
||||
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>
|
||||
|
|
Loading…
Reference in New Issue