Archived
This forum has been archived. Please start a new discussion on GitHub.
Invalid argument socket error on HP-UX
tctimmeh
in Help Center
I'm getting an unexpected error when trying to connect a client proxy to localhost on HP-UX in C++. The error I'm getting is:
my sample app:
and my make command:
I've found that this error only occurs when these two conditions are met:
I'm wondering if I'm doing something wrong or if this is expected behaviour on HP-UX and I just need to handle it.
Any thoughts?
Network.cpp:1661: Ice::SocketException: socket exception: Invalid argument
my sample app:
#include "iostream"
#include "Ice/Ice.h"
using namespace std;
using namespace Ice;
int main(int argc, char** argv) {
try {
CommunicatorPtr ic = initialize(argc, argv);
ObjectPrx prx = ic->stringToProxy("something: tcp -p 21378 -h localhost");
try {
LocatorPrx loc = LocatorPrx::checkedCast(prx);
} catch(ConnectionRefusedException& e) {
cout << "all good" << endl;
}
}
catch (exception& e) {
cout << "except: " << e.what() << endl;
}
return 0;
}
and my make command:
/opt/aCC/bin/aCC -AA +DAportable -mt -D_HPUX_SOURCE -I/usr/local/opt/Ice-3.3.0/include -L/usr/local/opt/Ice-3.3.0/lib asdf.cpp -lIce -o asdf
I've found that this error only occurs when these two conditions are met:
- Connecting to localhost in any way (supplying no -h, using 127.0.0.1, etc)
- The server is not running
I'm wondering if I'm doing something wrong or if this is expected behaviour on HP-UX and I just need to handle it.
Any thoughts?
0
Comments
-
That is definitely not expected behavior. We tested HP-UX 11.11 (PA-RISC) with HP aCC 3.56, 32/64 bit (as outlined on http://www.zeroc.com/platforms.html) extensively during the Ice 3.3 release process, and did not encounter any failure.
What version of HP-UX and aCC are you using? Did you try any of the demos? Are they working? If the demos are working, and your application is not, then perhaps they can help you pinpoint the source of your problems (for example, perhaps your compiler and/or linker flags are incorrect).0 -
Finally got to those demos and they did indeed tell me what I needed to know. The demos are linking with libxnet and my make was not. Adding xnet to my build fixes the problem.
Is this documented anywhere and I just missed it? It's a bit scary because everything builds ok without xnet but fails at runtime.0
