Skip to content

Commit

Permalink
Convert client message to string
Browse files Browse the repository at this point in the history
  • Loading branch information
ajon542 committed May 25, 2016
1 parent 3273fca commit 9228898
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ClientComms/Server.cs
Original file line number Diff line number Diff line change
Expand Up @@ -97,10 +97,10 @@ private void ReceiveCallback(IAsyncResult ar)

if (bytesRead > 0)
{
Console.WriteLine("Server Received: {0}", bytesRead);

byte[] data = new byte[bytesRead];
Array.Copy(buffer, 0, data, 0, bytesRead);
string msg = Encoding.ASCII.GetString(data);
Console.WriteLine("Server Received: {0}", msg);

// Continue receiving data.
client.BeginReceive(buffer, 0, BufferSize, 0, ReceiveCallback, null);
Expand Down

0 comments on commit 9228898

Please sign in to comment.