Recent Posts

Pages: 1 ... 4 5 [6] 7 8 ... 10
GNE Library / Re: Compiling Error version 0.70 and 0.75
« Last post by Gillius on November 20, 2008, 06:01:21 PM »
Well, that is interested that it ever compiled. If you #include <climits> in gneintern.h, does it compile then? We should use the INT_MAX provided by the compiler. Although, really I should look into replacing that code with std::numeric_limit instead, the "C++" way of doing it.

If you can confirm that climits works, and/or std::numeric_limits works on your machine, then I will commit a patch to the subversion repository right away.
GNE Library / Re: Compiling Error version 0.70 and 0.75
« Last post by rdesgagn on November 20, 2008, 01:06:08 PM »
I solved my problem by adding this definition in gneintern.h

Code: [Select]
#define INT_MAX 2147483647

Will it cause any problem to GNE ?

GNE Library / Compiling Error version 0.70 and 0.75
« Last post by rdesgagn on November 20, 2008, 11:12:37 AM »
Hello all,

             I'm encountering a problem compiling GNE 0.70 or 0.75.  It always stops and gives me an error when compiling EventThreads.cpp :
Code: [Select]
[ 28%] Building CXX object src/CMakeFiles/gnelib.dir/EventThread.o
/home/rdesgagn/gne/gnelib0.75/src/EventThread.cpp: In member function ‘void GNE::EventThread::setTimeout(int)’:
/home/rdesgagn/gne/gnelib0.75/src/EventThread.cpp:82: error: ‘INT_MAX’ was not declared in this scope
make[2]: *** [src/CMakeFiles/gnelib.dir/EventThread.o] Error 1
make[1]: *** [src/CMakeFiles/gnelib.dir/all] Error 2
make: *** [all] Error 2

I looked at the other files and INT_MAX is used so I will have problem.  I searched if INT_MAX is defined in any other files but no.  Can someone help me here ?


GNE Library / Re: client not properly shutdown, can not reconnect
« Last post by Gillius on November 20, 2008, 08:54:40 AM »
Oh, the point that I ended up wanting to make is that HawkNL hasn't been maintained for quite a few years (and of course, GNE since 2004). So, we should check to make sure that there is no fault in GNE. If there isn't, then we should check if there is a reasonable way to workaround the problem. If there isn't, then we should try to fix HawkNL. But, I bet that Mr. Frisbee (author of HawkNL) probably is in the same state as I am with GNE and not really able to give time to maintain the library, so a fork might be needed in this case, unless it was fixed in the 1.7 beta series (but I think when I tried that with GNE before there were problems).
GNE Library / Re: client not properly shutdown, can not reconnect
« Last post by Gillius on November 20, 2008, 08:49:03 AM »
Sorry for the delayed reply.

So, normally when a socket in the group is closed, that method returns immediately with an error. But, you are saying if a client is terminated improperly it doesn't? OK, is this client on the same machine as the server, or a different machine? Right now GNE does use TCP under the hood as well as UDP. If a remote machine goes away completely and doesn't send a disconnect, then the server might not know about it for some time. However, I thought that most operating systems will close a "leaked" socket from a crashed app.

But, what I am talking about wouldn't cause your original problem with not being able to reconnect. Unless, what you are saying is that the nlPollGroup returned that the sockets were ready and GNE interpreted that as some data was received and it tried to read it and blocked?

I think I'll have to look into this a little more to understand what you've found. It's been too long since I've worked with this code.
GNE Library / Re: client not properly shutdown, can not reconnect
« Last post by archer on November 18, 2008, 04:23:23 AM »
I appreciate for your quick reply.

I think I find the problem.
"int numsockets = nlPollGroup(group, NL_READ_STATUS, sockBuf, NL_MAX_GROUP_SOCKETS, 250);"
In ConnectionEventGenerator.cpp. if the client not proplerly shutdown, the function nlPollGroup will receive no error, produce no tips. it leads the code "listener->onReceive();" block forever, which waiting data to receive. so the server will not receive any other new client.
so it should be the HawkNL problem

GNE Library / Re: client not properly shutdown, can not reconnect
« Last post by Gillius on November 16, 2008, 09:33:05 PM »
I wonder if you are affected by the following bug fixed since 0.70:

Moved a "thread starting" debugging call that was causing a deadlock, typically on multi-CPU or dual-core systems.

In general, 0.70 is very old (of course, so is the latest unreleased version). I haven't worked on GNE actively for several years so it is hard for me to say. Do you know for certain that it blocks in join? The join should be pretty safe, and it is expected that it would block there waiting for some thread. However, if the thread isn't ending (because it is deadlocked), then the join waiting on it will never end either (but it isn't the problem).
GNE Library / client not properly shutdown, can not reconnect
« Last post by archer on November 16, 2008, 08:28:42 PM »
Hi all,

I’m using Delta3d 2.1 under Windows XP, Visual Studio 2005, gne 0.7.

I have a server running, accepting connections. A client connect to the server, quit not properly, for example, end client process in taskmgr.exe. then next time, the client try to reconnect to the server, it will block forever. I think it block in the Thread::join.
void Thread::join() {
  assert( started );
  if ( started ) {
    LockMutex lock( joinSync );
    if ( !joined ) {
#ifdef WIN32
      valassert(WaitForSingleObject( id->hThread, INFINITE), WAIT_OBJECT_0);
      valassert(pthread_join( id->thread_id, NULL ), 0);
      joined = true;
I try to use ‘3000’ instead of ‘INFINITE’, the client will not block, but can not connect to the server unless the server restart.

Here is the net.log
Thread.cpp, line  124, thrd     main: 5d8f0ec: Thread created
ClientConnection.cpp, line   47, thrd     main: 5d8f0b8: created
Thread.cpp, line  124, thrd     main: 5d90280: Thread created
EventThread.cpp, line   37, thrd     main: 5d90280: created
Thread.cpp, line  324, thrd     main: 5d8f0ec: Starting Thread CliConn
ClientConnection.cpp, line  118, thrd  CliConn: 5d8f0b8: Trying to connect to
ClientConnection.cpp, line  205, thrd  CliConn: 5d8f0b8: Sending the CRP.
ClientConnection.cpp, line  211, thrd  CliConn: 5d8f0b8: Waiting for the CAP.
Thread.cpp, line  124, thrd  CliConn: 5d90a08: Thread created
PacketStream.cpp, line  380, thrd  CliConn: 5d90a08:   Negotiated current rate: 0, rate step: 0
PacketStream.cpp, line   63, thrd  CliConn: 5d90a08: PacketStream negotiated: max: 0 requested: 0
PacketStream.cpp, line   64, thrd  CliConn: 5d90a08: created
ClientConnection.cpp, line  215, thrd  CliConn: 5d8f0b8: Setting up the unreliable connection
ClientConnection.cpp, line  136, thrd  CliConn: 5d8f0b8: GNE Protocol Handshake Successful.
SyncConnection.cpp, line   39, thrd  CliConn: 5d91c58: created
SyncConnection.cpp, line   40, thrd  CliConn: 5d91c58: Wrapping Connection 5d8f0b8 into a SyncConnection.
Thread.cpp, line  324, thrd  CliConn: 5d90a08: Starting Thread PktStrm
Thread.cpp, line  324, thrd  CliConn: 5d90280: Starting Thread EventThr
Connection.cpp, line  348, thrd  CliConn: 5d8f0b8: Registered reliable socket 0
Connection.cpp, line  352, thrd  CliConn: 5d8f0b8: Registered unreliable socket 1
ClientConnection.cpp, line  163, thrd  CliConn: 5d8f0b8: Starting onConnect r: 0, u: 1
SyncConnection.cpp, line  138, thrd  CliConn: 5d91c58: Releasing Connection 5d8f0b8
SyncConnection.cpp, line   58, thrd  CliConn: 5d91c58: destroyed
Thread.cpp, line  112, thrd  CliConn: 5d8f0ec: Thread CliConn Ending

Is it a bug? Or could you give me some suggestions?
Think you very much

GNE Library / Re: About threads in gne
« Last post by irado on September 12, 2008, 12:33:34 PM »
Thanks for your attention

I will continue searching. I want find one networking library free that suport this connections, but i think that i cannot find one free.

If i dont find i will try do something using hawknl and your threads.

thanks again.
GNE Library / Re: About threads in gne
« Last post by Gillius on September 12, 2008, 11:53:51 AM »
I don't know of one, and I'm not sure whether or not Raknet is suitable for server with a large number of connections or not. I looked at the Raknet site, looks like it is gone quite a long way since I last looked at it. I found Raknet sometime after I started working on GNE and noticed that it had a lot of the same goals as GNE but had a very different design. I didn't like it at the time because it seemed very "C-like" and not a very modern design but skimming it now it seems that there is a lot more to it now with a lot of docs and object models, etc, and does a lot more than I would have gotten working in GNE. The only thing GNE would probably be able to offer now is a different (open-source) license, but Raknet appears to be free (of cost) and includes source for non-profit applications.

If Raknet has gone under continuous development since the last time that I saw it about 4 years ago, I would suspect it to be a better choice than GNE.

However, that doesn't really answer your question on a server to support 1000 connections. You'll have to look at Raknet yourself and decide that.
Pages: 1 ... 4 5 [6] 7 8 ... 10