quickfix to test netorking

This commit is contained in:
SCM6WE
2021-09-21 14:01:36 +02:00
parent 4780fc3b03
commit b2c779f546
2 changed files with 4 additions and 1 deletions

View File

@@ -5,6 +5,7 @@ using SocketIOSharp.Server.Client;
using Json.Net; using Json.Net;
using System.Threading; using System.Threading;
using PolyChat.Models.Exceptions; using PolyChat.Models.Exceptions;
using System.Diagnostics;
namespace PolyChat.Models namespace PolyChat.Models
{ {
@@ -12,7 +13,7 @@ namespace PolyChat.Models
{ {
private SocketIOClient connection_client = null; private SocketIOClient connection_client = null;
private SocketIOSocket connection_server = null; private SocketIOSocket connection_server = null;
private Boolean connected = false; private Boolean connected = true;
private String ipSelf; private String ipSelf;
public Client(SocketIOClient connection, String ip) public Client(SocketIOClient connection, String ip)
@@ -44,6 +45,7 @@ namespace PolyChat.Models
{ {
new Thread(() => new Thread(() =>
{ {
Debug.WriteLine($"connected is {connected}");
//create msg //create msg
Message msg = new Message(chatMessage, false, Controller.ip); Message msg = new Message(chatMessage, false, Controller.ip);

View File

@@ -30,6 +30,7 @@ namespace PolyChat.Models
Server = new SocketIOServer(new SocketIOServerOption(Port)); Server = new SocketIOServer(new SocketIOServerOption(Port));
Server.OnConnection((socket) => connectNewClient(socket)); Server.OnConnection((socket) => connectNewClient(socket));
Server.Start(); Server.Start();
Debug.WriteLine($"Your ip is: {ownIP}");
Debug.WriteLine($"Server started, binding to port {Port}, waiting for connection..."); Debug.WriteLine($"Server started, binding to port {Port}, waiting for connection...");
} }