Menu

SampleSocketPort

Help
2002-01-16
2002-01-17
  • Alex Pavloff

    Alex Pavloff - 2002-01-16

    Hey folks -- I'm trying to run the SampleSocketPort demo, and it appears that the bind() call in the TCPSocket constructor is failing when called with LocalHost as the host address.

    Why is this?

    Thanks!

    Alex

     
    • Nick Liebmann

      Nick Liebmann - 2002-01-17

      The usage of the InetHostAddress constructor changed, and INADDR_ANY in the constructor call now evaluates to GetHostAddress(), so you will find that it is bound to the real IP of the machine, not the loopback address.

      I have released a patch for the SampleSocketPort (see Patches 500413).

      A quick fix for this is to insert the line
      LocalHost = INADDR_ANY, after the object has been created ~line 327.....

      ALternativly it has been suggested (see BUG 499495), that the default (empty) constructor be used for InetHostAddress. I have not tested that personally.

      The patch fixes this, and some other bugs..

      You need to be using at least cc++ 1.9.4 as previous versions had serious bugs in the SocketService implementation.

      regards

      Nick

       
    • Alex Pavloff

      Alex Pavloff - 2002-01-17

      1.9.4?

      I'll assume you meant 1.9.3, get the patch, and be off on my merry way.

      Thanks!

       
    • Nick Liebmann

      Nick Liebmann - 2002-01-17

      There is a 1.9.4 I assure you ;-). You will need it...

      ftp://ftp.gnu.org/pub/gnu/commonc++/commonc++-1.9.4.tar.gz

       

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.