[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-bugs-dist
Subject:    Bug#47256: Some ideas to make KExtendedSocket more usable
From:       0mecir () pauli ! fmph ! uniba ! sk
Date:       2002-08-31 9:40:03
[Download RAW message or body]

Package: kdelibs
Version: KDE 3.0.2 
Severity: wishlist
Installed from:    Mandrake RPMs
Compiler:          Not Specified
OS:                Linux
OS/Compiler notes: Not Specified

Greetings,

I'd like to post info about one problem I had when I was trying to use \
KExtendedSocket class, as well as some ideas on how to fix/improve this.

The problem is, that there's no good way to use the class for more connections (only \
one at a time, of course). First I tried to use the same instance - didn't work - \
when object is in Done status, there's no way to make it accept new connections (at \
least I haven't found one).

So I tried another approach - KExtendedSocket would only exist while it's connected, \
it would be deleted on disconnecting and created again while establishing a new \
connection.  However, this didn't work as well, it crashed while disconnecting \
instead. Problem is, that there's no way to determine, when it's safe to delete the \
object. Logical place would be closed(int) signal, but it's emitted more than once \
(three times in my case, with params 16,16,64, but I have no idea why this happens or \
how to predict which signal is the last one).

Finally, I managed to find a way around the problem, but it's a bit hacky:
The KExtendedSocket instance is kept in memory when disconnected, it's only deleted \
when a new connection is about to be established, then a new instance is created and \
used immediately.


My ideas how to improve this:

- add some disconnected() signal (or modify closed(int) to be emitted only once) that \
would be emitted when it's disconnected and it's also safe to delete the class \
(delete socket in connected slot won't cause application to crash).

- add some reset() method that would clear buffers etc. and prepare the class for \
another use.

By the way: there's nothing in the docs about SOCKS; I think it's used transparently \
when needed, but this should probably be part of documentation, don't you think so? \
;)

That's all for today, please excuse the length of this report...

With best wishes

/ Tomas

(Submitted via bugs.kde.org)


(Complete bug history is available at http://bugs.kde.org/db/47/47256.html)


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic