![]() |
Feedback Hi Max, no there isn't a build-in solution, you have to do that on your own right now. Okay, I came to the conclusion that original CAsyncSocket isn't good enough. I did run into so many problems which could not be solved in an elegant way together with the existing class and methods. Problem number 1 are things that take time and so do not match to the nature of an asynchronous-non-blocking class: no solution for friendly TCP disconnect and DNS resolutions. Problem number 2 is the fact that the class does not work with multithreading -or- it does not provide access to an internal message queue (much better to avoid all semaphore difficulties) and optional control via an external heartbeat. So that finally all critical can be easily done within same thread context. If you tried once to close sockets from another thread you will see what I mean (nasty MFC assert). Problem number 3 is the lack of comfortable functions for socket status requests, buffer management and build-in proxy support. Advanced users of a socket class will miss those things and typically have to reimplement them in every project. I have to say CAsnycSocket is nice, but suboptimal, an upgrade is highly necesarry IMHO. Well, now that I'm nearly finished with my test software (still trying to find more weak points)... I can spend the next months spare time with an implementation of an own and improved socket class. For sure Mutella's socket class is a good starting point. Greets, Moak PS: Max, I'm outa active Gnutella development ... I described my problems with this community in another thread. But I wanted to give some feedback here, I still work on network classes. |
Quote:
with regard to closing sockets i wasn't talking about CAsyncSoclet, but about sockets in general. Looks like there is no elegant way to do it at all -- neither poll(), nor select() provide support for safe-async-close, so the only solution I see is to call ioctl() in 'OnTimer()' or in 'Heartbeat()' to see if send buffer of the socket we'd like to close has cleared up... regards, still hope to see you around --Max |
All times are GMT -7. The time now is 11:09 PM. |
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
SEO by vBSEO 3.6.0 ©2011, Crawlability, Inc.
Copyright © 2020 Gnutella Forums.
All Rights Reserved.