Skip to content

Commit

Permalink
PR feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
davidfowl committed May 30, 2019
1 parent 9b290b0 commit 47917d6
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -78,16 +78,16 @@ async Task EchoServer(ConnectionContext connection)

using (var socket = new Socket(AddressFamily.Unix, SocketType.Stream, ProtocolType.Unspecified))
{
socket.Connect(new UnixDomainSocketEndPoint(path));
await socket.ConnectAsync(new UnixDomainSocketEndPoint(path));

var data = Encoding.ASCII.GetBytes("Hello World");
socket.Send(data);
await socket.SendAsync(data, SocketFlags.None);

var buffer = new byte[data.Length];
var read = 0;
while (read < data.Length)
{
read += socket.Receive(buffer, read, buffer.Length - read, SocketFlags.None);
read += await socket.ReceiveAsync(buffer.AsMemory(read, buffer.Length - read), SocketFlags.None);
}

Assert.Equal(data, buffer);
Expand Down

0 comments on commit 47917d6

Please sign in to comment.