Discussion:
[Clanlib-devel] Problem with clanNetwork - NetChannel example
Jason Green
2006-01-12 20:24:43 UTC
Permalink
At least on Windows, the NetChannel example doesn't work. It compiles
fine, but nothing ever displays when you run it.

I debugged it down to the file socket_generic.cpp, line 142:

ref_count--; // line 141
if (ref_count == 0) delete this; //line 142

The function never returns from that line. If I comment that line out
and recompile, the whole example works fine, but I'm guessing that might
cause some sort of memory leak? (I really have no idea, I'm just
testing some examples)

If anyone has a clue how the networking code works, please take a look
at that example and see if you know what's going on, or if it's a
problem in clanNetwork. Thanks!
Magnus Norddahl
2006-01-12 23:56:15 UTC
Permalink
Post by Jason Green
If anyone has a clue how the networking code works, please take a look
at that example and see if you know what's going on, or if it's a
problem in clanNetwork. Thanks!
I added some code to make the sockets linger when being destroyed
(suboptimal solution, but winsock's inner workings combined with the
network API of 0.8 made this the only easy way out). If that code fails
somehow, it would hang at that point (in ~CL_Socket_Impl waiting for an
event to be flagged).

I never actually tested the 0.8 implementation of this code, so its quite
possible it could have some silly bug.

--
Magnus Norddahl

Loading...