gm-devel
[Top][All Lists]
Advanced

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

Re: [Gm-devel] Protocol issues, and more.


From: Henrik Abelsson
Subject: Re: [Gm-devel] Protocol issues, and more.
Date: Sun, 09 Dec 2001 01:30:50 +0100
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:0.9.6) Gecko/20011120

Jesse Lovelace wrote:

Hi all,

I've got some questions and comments about the protocol stuff.

1st - Not all the protocols call removeNet() in their destructor, why not?
(see comment 5 before taking action)

Hmm.. good question.



2nd - As far as I can see, the sockets (Network *)s are never deleted, in my
client I'm doing this in the ProtocolManager destructor (otherwise I have a
HUGE memory corruption):
 list<Network *> lMyNetworkSockets = getNetsAll();

 for(list<Network *>::iterator it=lMyNetworkSockets.begin(); it !=
lMyNetworkSockets.end(); it++)
   ((wxNetwork *)(*it))->Destroy();

On this same thought,  why do we only remove the socket from event handling and 
not *really* delete it in the removeNet()?

I don't know really, it might have triggered a crash, or maybe i just forgot about it. :)


3rd - the wx client is working! woot!  TOC works great but I had to adapt
the tocprotocol a little bit.  For some reason, in the QT client if you do
multiple send_flaps() in the same function, the socket sends them as all one
big packet.  My sockets dont work this way so I added functions that
returned the flap packet as a string, cat-ed the strings together, then send
the whole thing at the end of the function.

ack! i have had no end of trouble because of that. The (qt) sockets are buffered so writes that come quickly are sent as one ip packet. It may speed things up, but it's terribly confusing, bugprone and just generally bad (of course, if you've done everything else right it just speeds things up)

you did it the Right Way, please commit the changes to the toc protocol.


4th - Does the yahoo or msn protocols work?  I haven't got to play with them
much but I was just wondering their status.

the MSN protocol works, somewhat. It's probably buggy, since i don't use it regularly. The Yahoo protocol isn't finished i think. Emil?


5th - Unfortunantly, adding removeNet() to all of the protocol's destructors
makes it impossible for me to use my above code becuase removeNet takes the
pointer out of the m_nets vector.  The only way I can see to fix this is to
actually destroy the sockets in removeNet()

It's probably what could be done.. delete the sockets there and see what happens :) Just make sure it's removed from all event loops: having deleted sockets that the main loop still thinks is active can only lead to trouble..

-henrik





reply via email to

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