Code Monkey home page Code Monkey logo

Comments (4)

thomas-mangin avatar thomas-mangin commented on May 22, 2024

From thomas.mangin on July 18, 2013 23:39:18

Status: Accepted

from exabgp.

thomas-mangin avatar thomas-mangin commented on May 22, 2024

From thomas.mangin on July 18, 2013 23:52:29

There is reason to my madness, when stopping and restarting ExaBGP, the kernel takes a few seconds to free the socket and if you try a new outgoing connection to the same host, the connection can then fail. On OSX, using this trick, prevent the issue and allows faster reconnection.

I agree that if you are binding on a port to accept incoming connection this would however be un-advisable and I will check that the mercurial code does indeed only use REUSE_PORT on outgoing connections.

I am surprised that the code prevents the socket to be created, as the exception handler should make this an "nice to have" not a mandatory requirement.

Please let me know if you agree with my statements, and what exception is raised on you machine.

Thank you for your time and help.

from exabgp.

thomas-mangin avatar thomas-mangin commented on May 22, 2024

From [email protected] on July 19, 2013 00:31:16

Being able to rebind on restart should be the effect of SO_REUSEADDR exclusively. But maybe this is different when binding the client side to a port. SO_REUSEPORT may exist in Python but may not be supported by the kernel. In this case, I get a socket.error "[Errno 92] Protocol not available".

from exabgp.

thomas-mangin avatar thomas-mangin commented on May 22, 2024

From thomas.mangin on July 19, 2013 04:45:16

Quickly reading http://stackoverflow.com/questions/14388706/socket-options-so-reuseaddr-and-so-reuseport-how-do-they-differ-do-they-mean-t It would seems that if you tear down your connection fast enough, you can encounter conflict with previous connection in TIME_WAIT if the source port is not chosen randomly enough. So I believe the option should stay for outgoing connection (only) as it is now - unless I mis-read the page (which I could as I am with limited net connectivity and I am trying to answer quickly).

I am now intercepting socket.error, so even if it is useless and if the kernel does not implement it, it should not prevent the program to start from now on.

This was indeed only set for outgoing connection so I will close this issue.

Thank you again. https://code.google.com/p/exabgp/source/detail?r=2dbe1fd090a4c89505cf7eb93e688aa63cc9f40b

Status: Fixed

from exabgp.

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.