Home › Forums › Support › PC terminal and mobile terminal connection cannot be returned › Reply To: PC terminal and mobile terminal connection cannot be returned
August 27, 2014 at 01:37
#3017
Anonymous
Inactive
Thanks for your reply,
I think Android and PC communication like PC and PC like structures, with a few simple code can,But the PC end as the receiving end,Can receive it each time, and Android did not receive the return value。
PC:
//The message may receive value
NetworkComms.AppendGlobalIncomingPacketHandler<string>("Message", (header, connection, message) =>
{
Console.WriteLine(message);
Console.WriteLine(connection.ConnectionInfo.RemoteEndPoint);
connection.SendObject("Retuen", "1");
});
Connection.StartListening(ConnectionType.TCP, new IPEndPoint(IPAddress.Parse(ip), port));
Console.ReadKey(true);
Android:
`
//I cannot receive the return value
string i = NetworkComms.SendReceiveObject<string, string>(“Message”, ip, port, “Retuen”, 1000, “Hello Word”);`