Subject: [Nel] Newbie problem

From: Patrick Herrmann <[email-masked]>
Date: Wed, 3 Oct 2001 11:07:09 -0400

Hi,

I'm trying to launch some NeL services (the naming_service, for instance), 
but I get the following errors:
	variable "Rec" not found in file "naming_service.cfg"
	variable "SId" not found in file "naming_service.cfg"
	variable "BasePort" not found in file "naming_service.cfg"

I checked, I don't have anywhere any file called naming_service.cfg. Could 
someone give me some information about this file,a nd how it should be 
formatted.

Thank you,

Patrick

---

From: "Vianney Lecroart" <[email-masked]>
Date: Wed, 3 Oct 2001 12:38:10 +0200

Hi Patrick,

> variable "BasePort" not found in file "naming_service.cfg"

You are wrong, in fact, it's not *errors* but only *warnings*. Look the 3
first letters, it's WRN for warning and INF for information.
In fact, the message says that the variable is not found but these variables
are optional and you don't need them in normal case.

nevrax@net2:~/build/release/nelns/naming_service$ ./naming_service
INF 2840 service.cpp 363 : Starting Service 'NS' using NeL (Sep 28 2001
15:06:09)
WRN 2840 config_file.h 281 net2.nevrax.net/NS : Exception will be launched:
variable "Rec" not found in file "naming_service.cfg"
WRN 2840 config_file.h 281 net2.nevrax.net/NS : Exception will be launched:
variable "SId" not found in file "naming_service.cfg"
WRN 2840 config_file.h 281 net2.nevrax.net/NS : Exception will be launched:
variable "BasePort" not found in file "naming_service.cfg"
INF 2840 service.cpp 720 net2.nevrax.net/NS : Service ready

If you see the message "Service ready", it's ok, otherwise, find and try to
understand the ERR message :)

> someone give me some information about this file,a nd how it should be

There s no need for config file for naming_service. But when a config file
is needing, we put it in the CVS at the same place where the sources are.
The config file must be in the same directory that the executable so copy it
if necessary. If you want an example, take a look on the time_service.cfg.

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?

---

From: Patrick Herrmann <[email-masked]>
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);

---

From: "Vianney Lecroart" <[email-masked]>
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.

> 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
---

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

> _______________________________________________
> Nel mailing list
> [email-masked]
> /mailman/listinfo.cgi/nel
>

---

From: Patrick Herrmann <[email-masked]>
Date: Thu, 4 Oct 2001 12:11:49 -0400

Hi,

Right, I forgot to start all needed services from nelns. So I launched:
	the naming_service
	the time_service
	the log_service
	the login_service
	the admin_executor_service
	the admin_service
	the welcome_service
All services told me they are ready. Then I started my personnal service, 
and...
	"INF32165 service.cpp 363 : Starting Service 'KGE' using NeL (Oct  4 2001 
10:54:12)
	Segmentation fault"

I checked the log.log file, but it was still empty.

I noticed that the pacs_service is not included within the global Makefile. I 
added it, but I got some errros when compiling. Anyway, right now, although I 
started all possible services, I am not able to start the one I coded.

Patrick

P.S.: Ouaou, I wondered myself how I could write the "cout" line of code! 
Thanks to point it out. It didn't solve the problem.

On Thursday 04 October 2001 04:49 am, you wrote:
> 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.
> string format in the same line, I really don't tink that it could work
> fine, you should put:
> 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?
>
> > The following code is compiling and linking very well, but when launching
>
> the
>
> > I figured out that it was the call to the function NLNET_SERVICE_MAIN
> > that causes the error.
> >
> > #include "nel/net/callback_net_base.h" // Declaration of the
>
> CCallbackNetBase
>
> > void cbProcessConnection(CMessage& message, TSockId from,
>
> CCallbackNetBase&
>
> > nb)
> > {
> > void cbProcessReceivedMsg(CMessage& message, TSockId from,
>
> CCallbackNetBase&
>
> > nb)
> > {

---

From: "Vianney Lecroart" <[email-masked]>
Date: Thu, 4 Oct 2001 12:28:18 +0200

Without more informations, I don't know why the crash occurs. Try to compile
in debug mode and use gdb and look where it crashs

Vianney Lecroart
---