Coder Social home page Coder Social logo

Comments (7)

Toemsel avatar Toemsel commented on July 17, 2024

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

from network.

SheppeR avatar SheppeR commented on July 17, 2024

Thank you for your answer, I will use your suggestion.

from network.

SheppeR avatar SheppeR commented on July 17, 2024

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);
        }

from network.

Toemsel avatar Toemsel commented on July 17, 2024

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

from network.

SheppeR avatar SheppeR commented on July 17, 2024

its a auto generated method with parameter from
image

The server is exactly the same code as the example from repo but AllowUDPConnections set to false

from network.

Toemsel avatar Toemsel commented on July 17, 2024

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

from network.

SheppeR avatar SheppeR commented on July 17, 2024

no problem client send / receive packet now

from network.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.