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
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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
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
1.9.4?
I'll assume you meant 1.9.3, get the patch, and be off on my merry way.
Thanks!
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