Go Back   ZeroC Forums > Help Center

Reply
 
LinkBack Thread Tools Rate Thread Display Modes
  #1 (permalink)  
Old 03-07-2008
jingkewhu jingkewhu is offline
Registered User
 
Name: JingKe
Organization: WuHan University, China
Project: It's a chat room
 
Join Date: Mar 2008
Posts: 2
Get "Assertion failed" in ConnectionMonitor.cpp, with Ice-3.0.1-VC80

I get a problem in my VC++ code:

"Assertion failed!
File: .\ConnectionMonitor.cpp
Line: 65
Expression: !_instance
version: Ice-3.0.1-VC80
platform: Win XP SP2
compile: VS 2005

code:
I want to test how many clients can my server support,

In the class VDClient
=======
bool VDClient::InitClient(string strMac, string strServerIP, string strPort =

"10040", string strTimeout = "5000")
{
try
{
int argc = 0;
//Ice::InitializationData initData;
Ice::PropertiesPtr properties = Ice::createProperties();

//
// Set a default value for "Hello.Proxy" so that the demo will
// run without a configuration file.
//
m_strMac = strMac;
string strVDSrvProxy = "VDSrvCtrl:tcp -h ";
strVDSrvProxy += strServerIP;
strVDSrvProxy += " -p " + strPort;
strVDSrvProxy += " -t " + strTimeout;


properties->setProperty("VDSrv.Proxy", strVDSrvProxy);
properties->setProperty("Client.Endpoionts", "tcp");
//initData.properties->setProperty("Ice.ThreadPool.Client.Size",

"5");
//initData.properties->setProperty("Ice.ThreadPool.Client.SizeMax",

"10");

communicator = Ice::initializeWithProperties(argc, 0, properties);
VDPrx = VD::VDSrvPrx::checkedCast(communicator->stringToProxy

(properties->getProperty("VDSrv.Proxy")));

if(!VDPrx)
{
string err = "ErrorMessage";
GlobalFunc::instance()->PrintMessage(err);

return false;
}


std::string _uuid = IceUtil::generateUUID();
ident.name = _uuid;
ident.category = "";
clientAdapter = communicator->createObjectAdapter(properties-

>getProperty("Client"));

ptrVDClient = new VDClientProxyI();
clientAdapter->add(ptrVDClient, ident);
clientAdapter->activate();
VDPrx->ice_connection()->setAdapter(clientAdapter);

return true;
}
catch(const Ice::Exception& ex)
{
ostringstream ostr;
ostr << ex;
string s = ostr.str();
string err = "Error:" + s;
VDPrx = NULL;

GlobalFunc::instance()->PrintMessage(err);
return false;
}
catch (...)
{
VDPrx = NULL;
GlobalFunc::instance()->PrintMessage("Error");
return false;
}

}
=========


===========
for (int i = 0; i < MaxClientNum; i++)
{
VDClient* pVD = new VDClient();
pVD->InitClient("8888", "192.168.101.87", "10040", "5000");
DoSomething();
delete pVD;
pVD = NULL;
}
===========
when MaxClientNum is 1000 or larger, I get the above problem, how can i fix it,
Thanks!


VDSrv.ice
===========
#ifndef VD_ICE_PC
#define VD_ICE_PC

#include <Ice/Identity.ice>
#include <Ice/BuiltinSequences.ice>

module MapC
{
dictionary<string, string> Context;
};


module VD
{

interface VDSrv
{
MapC::Context RequestToServer();
void HeartBeatRegister(Ice::Identity ident);
};

};

#endif
================

VDClientProxy.ice
====================
#ifndef VDClient_ICE_PC
#define VDClient_ICE_PC

#include <Ice/Identity.ice>
#include <Ice/BuiltinSequences.ice>

module VDProxy
{

interface VDClientProxy
{
void SendMessage();
};

};

#endif
================
Reply With Quote
  #2 (permalink)  
Old 03-07-2008
benoit's Avatar
benoit benoit is offline
ZeroC Staff
 
Name: Benoit Foucher
Organization: ZeroC, Inc.
Project: Ice
 
Join Date: Feb 2003
Location: Rennes, France
Posts: 1,470
Hi,

We only provide free support on the forums for the latest Ice version. Could you upgrade to 3.2.1 and see if you still get this assert?

Thanks,

Cheers,
Benoit.
Reply With Quote
  #3 (permalink)  
Old 03-07-2008
jingkewhu jingkewhu is offline
Registered User
 
Name: JingKe
Organization: WuHan University, China
Project: It's a chat room
 
Join Date: Mar 2008
Posts: 2
ok
I'll try it
Thanks
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Don't "Ice-3.1.1-VC71.msi " include the "slice2java.exe"? Jason Gao Help Center 4 10-26-2006 11:23 AM
Debug Assertion Failed! ... Expression: _BLOCK_TYPE_IS_VALID(pHead->nBlockUse)". ablo_zhou Help Center 1 07-27-2006 04:05 AM
"Invalid UTF8 string" when transer chinese chars between cpp server and csharp client raygo Help Center 8 03-21-2006 08:34 PM
"Assertion Failed" on Communicator.Destroy DeepDiver Help Center 11 09-20-2005 03:12 AM
Going from "in" to "out" param, using a class as a union catalin Help Center 1 04-05-2004 08:55 AM


All times are GMT -4. The time now is 07:04 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.0.0
(c) 2008 ZeroC, Inc.