Home Help Center

Run demo program error

I just run demo\Ice\MFC\server,it reports Exception:
"c:\src\vc60\stage\Ice-3.0.0\src\ice\Network.cpp:475: Ice::SocketException:
socket exception: WSAEADDRINUSE"

code:

InitCommonControls();

CWinApp::InitInstance();

//
// Create a communicator and object adapter.
//
Ice::CommunicatorPtr communicator;
Ice::ObjectAdapterPtr adapter;
LogIPtr log;
try
{
int argc = 0;
Ice::PropertiesPtr properties = Ice::createProperties();
properties->load("config");
communicator = Ice::initializeWithProperties(argc, 0, properties);
log = new LogI;
communicator->setLogger(log);
adapter = communicator->createObjectAdapter("Hello");
}
catch(const IceUtil::Exception& ex)
{
ostringstream ostr;
ostr << ex;
string s = ostr.str();
AfxMessageBox(CString(s.c_str()), MB_OK|MB_ICONEXCLAMATION);
return FALSE;
}



when it goes to red line , there will thow out a excepiton。

Comments

  • matthewmatthew NL, CanadaMember Matthew NewhookOrganization: ZeroC, Inc.Project: Internet Communications Engine ✭✭✭
    That exception means that some other application is already listening on the port you are selecting. You need to either change the port, or kill the offending application.
Sign In or Register to comment.