nel-all
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Nel] Newbie problem - Once again!


From: Vianney Lecroart
Subject: Re: [Nel] Newbie problem - Once again!
Date: Thu, 4 Oct 2001 10:49:07 +0200

Hello,

You should take a look into the log.log file or to the stdout log because
the reason should be explain. I tried your service and it started without
problem.
The first problem could be that you don't create the kge_config.cfg with the
2 variables that say where the naming service is. Copy the time_service.cfg
for example, and remove only the UniTime variable.
Another posibility is that you didn't launch the admin_executor_service,
naming_service and time_service before running your service so it could not
find these standard services.
But without any log, I can't say exactly what is your problem.

You have writtent that in your service:
> cout << "KGE_1.0 | Processing connection | Message: %s\n",
message.toString();
I never see a so strange this things, you try to mix up cout and printf
string format in the same line, I really don't tink that it could work fine,
you should put:
   cout << "KGE_1.0 | Processing connection | Message: " <<
message.toString() << endl;
or
   printf  ("KGE_1.0 | Processing connection | Message: %s\n",
message.toString().c_str()); /* don't format the c_str() to convert stl
string to char* */

Vianney Lecroart
---
lead network programmer / nevrax.com
icq#: 6870415
homepage: http://ace.planet-d.net
www.geekcode.com: GCS/E d- s+++: a-- C+++$ UL++ P- L+++>+$ E+>- W++ N+ o? K-
w++$ O- M- V- PS- PE? Y PGP t 5? X+ R- tv++ b- DI D+ G e++ h+ r-- y?

----- Original Message -----
From: "Patrick Herrmann" <address@hidden>
To: <address@hidden>
Sent: Thursday, October 04, 2001 1:40 AM
Subject: [Nel] Newbie problem - Once again!


> 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);
> _______________________________________________
> Nel mailing list
> address@hidden
> http://www.nevrax.org/mailman/listinfo.cgi/nel
>



reply via email to

[Prev in Thread] Current Thread [Next in Thread]