-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
新增两个 send 方法 #599
base: master
Are you sure you want to change the base?
新增两个 send 方法 #599
Conversation
ValueTask<int> Send(ReadOnlyMemory<byte> data); ValueTask<int> Send<TSendPackage>(IPackageEncoder<TSendPackage> packageEncoder, TSendPackage package); 返回发送字节数
@@ -20,6 +20,10 @@ public abstract class ChannelBase<TPackageInfo> : IChannel<TPackageInfo>, IChann | |||
|
|||
public abstract ValueTask SendAsync(Action<PipeWriter> write); | |||
|
|||
public abstract ValueTask<int> Send(ReadOnlyMemory<byte> buffer); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Send => SendAsync?
@@ -20,6 +20,10 @@ public abstract class ChannelBase<TPackageInfo> : IChannel<TPackageInfo>, IChann | |||
|
|||
public abstract ValueTask SendAsync(Action<PipeWriter> write); | |||
|
|||
public abstract ValueTask<int> Send(ReadOnlyMemory<byte> buffer); | |||
|
|||
public abstract ValueTask<int> Send<TPackage>(IPackageEncoder<TPackage> packageEncoder, TPackage package); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Send => SendAsync?
|
||
ValueTask<int> Send<TPackage>(IPackageEncoder<TPackage> packageEncoder, TPackage package); | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Extra line?>
|
||
WritePackageWithEncoder(arrayBufferWriter, packageEncoder, package); | ||
|
||
return await SendOverIOAsync(new ReadOnlySequence<byte>(arrayBufferWriter.WrittenMemory), CancellationToken.None); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Extra space.
ValueTask Send(ReadOnlyMemory data);
ValueTask Send(IPackageEncoder packageEncoder, TSendPackage package);
返回发送字节数