Skip to content

GitLab

  • Menu
Projects Groups Snippets
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • Trac Trac
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Issues 246
    • Issues 246
    • List
    • Boards
    • Service Desk
    • Milestones
  • Monitor
    • Monitor
    • Metrics
    • Incidents
  • Analytics
    • Analytics
    • Value stream
  • Wiki
    • Wiki
  • Activity
  • Create a new issue
  • Issue Boards
Collapse sidebar
  • Legacy
  • TracTrac
  • Issues
  • #2850

Closed (moved)
(moved)
Open
Created Apr 04, 2011 by Trac@tracbot

use of SO_REUSEADDR socket option, was: Error binding network socket: Address already in use

Blutmagie and Tory exits frequently log the error Apr 04 15:27:48.706 [warn] Error binding network socket: Address already in use

According to Roger's answer to my today's posting on tor-relays mailing list the SO_REUSEADDR socket option isn't used in all cases. It might be an idea to set this option in any case.

Roger's answer

Actually, we only use SO_REUSEADDR when binding listening sockets. The errors you're seeing are likely because you can't open a new socket for an outbound connection. And we don't use SO_REUSEADDR when creating outbound sockets: see connection_connect().

We also don't set SO_REUSEADDR on the new socket we make after receiving connections on a listening socket: see connection_handle_listener_read().

I don't know what behavior to expect, but I would not be surprised to learn that we should set it in both of these cases too. Worth experimenting.

--Roger

Trac:
Username: Falo

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking