Skip to main content
gamedev.net
🔒 Locked 🎮 Unity

Client error

Started by p4tr1ck 1 reply 1.2k views
Original Post
p4tr1ck
p4tr1ck
Hello.Immediately after my client's connection code to the server, I get repeated NetExceptions. Here's the connection code:



config = new NetPeerConfiguration("NetGame");
client = new NetClient(config);
client.Start();
// Registration message
NetOutgoingMessage registration = new NetOutgoingMessage();
registration.Write(username);
registration.Write(Game.version);
// Connect with the registration message
client.Connect(host, 3579, registration);
Console.WriteLine("[client] Connected to " + host + ", registering...");


After some debugging, I've discovered that the NetException is thrown because the NetConnectionStatus is RespondedConnect. Unfortunately I've got no idea what this means or how to fix it. The only idea I have is that it's just a failed connection, but I'm not sure. Any suggestions?
Thanks.
Butabee
Butabee

Hello.Immediately after my client's connection code to the server, I get repeated NetExceptions. Here's the connection code:



config = new NetPeerConfiguration("NetGame");
client = new NetClient(config);
client.Start();
// Registration message
NetOutgoingMessage registration = new NetOutgoingMessage();
registration.Write(username);
registration.Write(Game.version);
// Connect with the registration message
client.Connect(host, 3579, registration);
Console.WriteLine("[client] Connected to " + host + ", registering...");


After some debugging, I've discovered that the NetException is thrown because the NetConnectionStatus is RespondedConnect. Unfortunately I've got no idea what this means or how to fix it. The only idea I have is that it's just a failed connection, but I'm not sure. Any suggestions?
Thanks.



I think you have to create messages like this.... client.CreateMessage();

maybe that will solve the problem. Not sure though.
p4tr1ck
p4tr1ck
It doesn't appear to work. I'm getting the same error. sad.gif

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.