[ADDITION] servercommunication towards the client.

Still in progress not functional because of a null exception when receiving the broadcast message.
This commit is contained in:
Dogukan
2020-10-21 17:47:48 +02:00
parent 381c142eaa
commit 74f8e868f6
4 changed files with 25 additions and 12 deletions

View File

@@ -24,6 +24,7 @@ namespace SharedClientServer
public static (string,string) GetUsernameAndMessage(byte[] json)
{
string msg = Encoding.ASCII.GetString(json);
Debug.WriteLine("Sent data: {0}", msg);
dynamic payload = JsonConvert.DeserializeObject(msg);
return (payload.username, payload.message);
@@ -49,7 +50,6 @@ namespace SharedClientServer
}
/// <summary>
/// constructs a message that can be sent to the clients or server
/// </summary>