Sigsegv关于gsoap副本

时间:2012-01-30 15:22:59

标签: c++ qt wsdl gsoap

我正在尝试构建服务con gsoap。代码是:

ArchivatorCoreService server;
ArchivatorCoreService *tserver;
int port = 8080;
SOAP_SOCKET m, s;
m = server.bind(NULL, port, 100);
if (!soap_valid_socket(m))
{
      exit(1);
}
else
{
  qDebug() << "Info: Bind: Succesfully socket connection: " << m << ". Port " << port 
}
for (;;)
{
  qDebug() << "waiting...";
  s = server.accept();

  if (!soap_valid_socket(s))
  {
    if (server.errnum)
    {
       qDebug() << "1"; << "Error: Failed accept: " << messagec;
       exit(1);
  }
  else
  {
    qDebug() << "Info: Thread " << i << " accepts socket " << s << " connection from   IP " << ((server.ip >> 24)&0xFF) << "." << ((server.ip >> 16)&0xFF) << "." << ((server.ip >> 8)&0xFF) << "." << ((server.ip)&0xFF);

}
qDebug() << "2";
tserver = server.copy(); // make a safe copy
qDebug() << "3";

在行tserver = server.copy();错误sigsegv。

ArchivatorCoreService heracly of soap;

非常感谢你

1 个答案:

答案 0 :(得分:0)

你没有说你正在使用哪个版本的gsoap;但是,2.8.5之前的版本存在内存泄漏问题,而SIGSEGV与生成的C ++代码存在问题。有关详细信息,请参阅我之前的回答here