#306 Extend ServerSocket to be able to specify host to bind to

v1.2.0
open
Václav Zeman
6
2014-08-14
2014-06-24
No

Hello, log4cplus developers.

We are using your lib for our internal purposes and have faced with the following issue:

We use ServerSocket class to receive log events through network. But we need to restrict address our tool should bind to. Currently ServerSocket uses:

server.sin_family = AF_INET;
server.sin_addr.s_addr = INADDR_ANY;
server.sin_port = htons(port);

only port can be specified.

We have implemented our extended version. Please consider to include it into one of the future releases.

Your comments about our code are highly appreciate.

1 Attachments

Discussion

  • Václav Zeman
    Václav Zeman
    2014-06-24

    • assigned_to: Václav Zeman
     
  • Václav Zeman
    Václav Zeman
    2014-06-29

    • labels: --> patch, socket
    • Group: v1.1.2 --> future
     
  • Václav Zeman
    Václav Zeman
    2014-06-29

    • Description has changed:

    Diff:

    --- old
    +++ new
    @@ -2,11 +2,13 @@
    
     We are using your lib for our internal purposes and have faced with the following issue: 
    
    -we use ServerSocket class to receive log events through network. But we need to restrict address our tool should bind to. Currently ServerSocket uses:
    +We use `ServerSocket` class to receive log events through network. But we need to restrict address our tool should bind to. Currently `ServerSocket` uses:
    
    +~~~~{.c}
     server.sin_family = AF_INET;
     server.sin_addr.s_addr = INADDR_ANY;
     server.sin_port = htons(port);
    +~~~~
    
     only port can be specified.
    
     
  • Václav Zeman
    Václav Zeman
    2014-06-29

    Rather than creating a new socket class, it would be nice to improve the existing one. It would help if you posted a complete and testable patch.

     
    Last edit: Václav Zeman 2014-06-29
  • Hello,

    please consider the new version in the attach. Unfortunately I do not have Windows host for developing thus I adjusted only socket-unix.cxx.

     
  • Václav Zeman
    Václav Zeman
    2014-07-08

    • Group: future --> v1.2.0
    • Priority: 5 --> 6