gsoap 副本上的 Sigsegv
我正在尝试构建一个 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 肥皂剧;
非常感谢你
I'm tryning to build a service con gsoap. The code is:
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";
In line tserver = server.copy(); error sigsegv.
ArchivatorCoreService heracly of soap;
Thanks you very much
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
你没有说你正在使用哪个版本的 gsoap ;然而,2.8.5 之前的版本存在内存泄漏问题,并且生成的 C++ 代码存在 SIGSEGV 问题。请参阅我之前的回答此处了解更多详细信息。
You don't say which version of gsoap you are using; however versions prior to 2.8.5 have an issue with memory leaks and SIGSEGVs with the C++ code that is generated. See my previous answer here for a few more details.