Menu

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

v1.2.0
open
6
2016-03-15
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 Haisman

    Václav Haisman - 2014-06-24
    • assigned_to: Václav Zeman
     
  • Václav Haisman

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

    Václav Haisman - 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 Haisman

    Václav Haisman - 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 Haisman 2014-06-29
  • Maxim Kondratenko

    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 Haisman

    Václav Haisman - 2014-07-08
    • Group: future --> v1.2.0
    • Priority: 5 --> 6
     
  • Maxim Kondratenko

    Hello,
    Is there any progress on this matter?

     
  • Václav Haisman

    Václav Haisman - 2016-03-15

    I have applied a patch in the spirit of your patch onto master. I will take a look if I can easily transplant it also to 1.2.x. I am not sure if I will be adding it to 1.1.x at all.

     
    • Maxim Kondratenko

      I don't mind against adding this patch to 1.2 version.

       

      Last edit: Maxim Kondratenko 2016-06-23

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.