Question about AllowUDPConnections
SheppeR opened this issue · comments
Because the server rejects a UDP connection and kills the related TCP connection.
Then the ClientConnectionContainer receives the info that the UDP/TCP is dead and reconnects.
Hence, if you dont allow UDP, you can't use the ClientConnectionContainer. Use the TcpConnection only instead.
Hope that helps
Thank you for your answer, I will use your suggestion.
Hum sorry but since i create a tcp connection and not a container on client, packets stopped to be send
client is connected but nothing is send from the client
private void TestClient()
{
var container = ConnectionFactory.CreateTcpConnection("127.0.0.1", 8899, out _);
container.ConnectionEstablished += Established;
}
private void Established(TcpConnection con, UdpConnection arg2)
{
Console.WriteLine($@"{con} Connection established");
con.RegisterPacketHandler<LoginResponse>(OnResponseReceived, this);
con.Send(new LoginRequest("TEST", "TEST"), this);
}
The event subscriber seems strange with TCP and UDP as a parameter. However, please take a look at the examples:
https://www.indie-dev.at/2016/10/03/client-setup/
or on github
https://github.com/Toemsel/Network/blob/master/Examples/NetworkTestClient/SingleConnectionExample.cs
In order to help you even further, please also post the server code. Thanks
Thanks to point that out. It shouldn't be public in first place. Will change that later on.
Regarding your issue, dont use that event... It wont fire, since it will never be called (No UDP possible) and it shouldnt be visible in first place :)
Sorry for the inconvenience
no problem client send / receive packet now