Home Forums Support client-server to exchange files (like in p2p?) Reply To: client-server to exchange files (like in p2p?)

#1004
Anonymous
Inactive

Please help me to understand why I can’t have any returned message (I’ve payed you a beer 😉 )
I adde to my code:

//Start listening for new incoming TCP connections
			//Parameter is true so that we listen on a random port if the default is not available
			NetworkComms.DefaultListenPort = 10000;
			NetworkComms.AppendGlobalIncomingPacketHandler<string>("Message", PrintIncomingMessage);
			UDPConnection.StartListening (true);
			
			private static void PrintIncomingMessage(PacketHeader header, Connection connection, string message)
		{
			Console.WriteLine("\nA message was recieved from " + connection.ToString() + " which said '" + message + "'.");
		}

This is debug log ( 192.168.1.137 is the ip of the device is running the app)
…..
192.168.1.136:10000
192.168.1.137:10000
Thread started: <Thread Pool> #5
Thread started: <Thread Pool> #6
192.168.1.138:10000
Thread started: ManagedThreadPool_9 #7
192.168.1.139:10000
…..
the app is never passing on this line Console.WriteLine("\nA message was recieved from " + connection.ToString() + " which said '" + message + "'.");
Please tell me Why ?
–I’m running the cicle into a thread (It is not thinkable to do in the main thread, because app will freeze)–