[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Nel] Newbie problem - Once again!
From: |
Patrick Herrmann |
Subject: |
[Nel] Newbie problem - Once again! |
Date: |
Wed, 3 Oct 2001 19:40:13 -0400 |
Hi,
The following code is compiling and linking very well, but when launching the
generated application (executable), I get a "segmentation fault" error.
I figured out that it was the call to the function NLNET_SERVICE_MAIN that
causes the error.
I'm working on a Mandrake platform, using g++ compiler.
Thanks for your answer,
Patrick
#include "nel/net/service.h" // Declaration of the IService interface
#include "nel/net/message.h" // Declaration of the CMessage class
#include "nel/net/buf_server.h" // Declaration of type TSockId
#include "nel/net/callback_net_base.h" // Declaration of the CCallbackNetBase
class and type TCallbackItem
using namespace NLNET;
void cbProcessConnection(CMessage& message, TSockId from, CCallbackNetBase&
nb)
{
cout << "KGE_1.0 | Processing connection | Message: %s\n",
message.toString();
}
void cbProcessReceivedMsg(CMessage& message, TSockId from, CCallbackNetBase&
nb)
{
cout << "KGE_1.0 | Processing message | Message: %s\n",
message.toString();
}
TCallbackItem KGECallbackArray[] =
{
{ "MSG", cbProcessReceivedMsg },
{ "NEW", cbProcessConnection }
};
NLNET_SERVICE_MAIN (IService, "KGE", "kge_service", 0, KGECallbackArray);