I am reworking my network code having implemented a mostly working system using NetworkManager as a basis, I am reworking this to provide the same functionality without using the NetworkManager class itself.
I have managed to implement what seems to be a working server and client set of classes and can pass messages back and forth as I had done previously, however I cannot replicate the local connection that was possible with the StartHost method of NetworkManager.
When I created a connection with StartHost the connection id would be ‘-1’ indicating that it was using the internal queues to pass traffic. using NetworkClient.Connect(“127.0.0.1”,portno) creates an IP connection instead. Does anyone know what the correct incantation is to create a local client connection to the local server?
My current code works for remote clients as well as a local client connecting via the loopback address.
I have tried:
Network.Client("127.0.0.1", portno); // Connects but as an IP connection NetworkClient.Connect(null, portno); // null object error at Runtime NetworkClient.Connect("localhost", portno); // Connects but as an IP connection NetworkClient.Connect("", portno); // Connect Error: 11 !! possibly something here?
my ConnectionConfig object is very simple:
netConfig = new ConnectionConfig(); netConfig.AddChannel(QosType.Reliable);
and is used by both the NetworkClient and NetworkServer.
Searched the docs and cannot see anything. Anyone able to offer suggestions, answers?