Question by
vedus · Dec 28, 2015 at 08:34 PM ·
c#networkingconnectionsocket
Networking with TLAPI between two different projects
Hi,
I'm having some troubles with the TLAPI. Is it possible to send and receive messages trough two seperate projects (one dedicate server, one client).
I worked with this tutorial (http://www.robotmonkeybrain.com/good-enough-guide-to-unitys-unet-transport-layer-llapi/) but it doesn't work. The client send a message but the server doesn't receive anything.
switch (recNetworkEvent) {
case NetworkEventType.Nothing:
break;
case NetworkEventType.ConnectEvent:
Debug.Log("incoming connection event received");
break;
case NetworkEventType.DataEvent:
Stream stream = new MemoryStream(recBuffer);
BinaryFormatter formatter = new BinaryFormatter();
string message = formatter.Deserialize(stream) as string;
Debug.Log("incoming message event received: " + message);
break;
case NetworkEventType.DisconnectEvent:
Debug.Log("remote client event disconnected");
break;
}
NetworkEventType.ConnectEvent will be invoked but NetworkEventType.Data Event doesn't do anything.
Can anyone help me please? Thanks for your advices in advance
Comment