I can’t get the unity client/server stuff to work at all. I made a few sample games with the old networking versions, and on photon, but on 5.1 the client won’t connect.
After awhile I just get:
UNet Client Disconnect Error: Timeout
UnityEngine.Networking.NetworkIdentity:UNetStaticUpdate()
To try to make it as basic as possible I took everything out and have two instances running. One is calling
NetworkServer.Listen( 4444 );
and the other is calling:
client = new NetworkClient();
client.Connect( “localhost”, 4444 );
the port is open in my router. in place of “localhost” i’ve tried putting 127.0.0.1 and my actual ip address.
I’m not using the NetworkManager because it’s doing things I don’t want it to, and this page:http://docs.unity3d.com/Manual/UNetClientServer.html says I should be able to just make a client without it.
Bmandk
July 15, 2015, 1:18am
2
Can you put up the whole code? A bit hard to understand exactly what’s going on.
In terms of networking, there really is absolutely nothing else happening.
the client is using:
this.client = new NetworkClient();
client.RegisterHandler( MsgType.Connect, OnConnected );
this.client.RegisterHandler( MsgType.Error, this.OnNetClientError );
this.client.RegisterHandler( MsgType.Disconnect, this.OnDisconnect );
client.Connect( "127.0.0.1", 19451 );
the server is using:
NetworkServer.RegisterHandler( MsgType.Connect, OnConnected );
NetworkServer.RegisterHandler( MsgType.Error, OnServerError );
NetworkServer.RegisterHandler( MsgType.Ready, OnReady );
if ( !NetworkServer.Listen( 19451 ) ) {
Debug.Log( "SERVER: listen failed" );
}
The port is open on the router.
using ClientScene.ConnectLocalServer() DOES seem to work though I don’t understand why there is any difference.
In the past I could use the standard Connect() for both local and remote testing.