Hey Alex,

2009/2/16 Alex <[email protected]>:
> Some notes about using WSocketNotifier. There is very usefull class In some 
> cases. But:
> 1. source file Server.C,:  bool Server::socketSelected(...).
>     May be we must  call "delete s" AFTER ret = 
> Wt::WebController::instance()->socketSelected(descriptor) because we need 
> read from socket in notify()?

We fixed this by duplicating the socket which is given to asio: in
this way we can simply delete the asio socket when select returns. We
are also trying to work with the boost asio people to have a better
and simpler solution...

> 2. source WebController.C  WebController::socketSelected(int descriptor)
>     When work some concurent sessions with WSocketNotifier there always  dead 
> lock.

Good observation, and this is also solved now.

> 3. But after p.1(delete s) we have potential problem dublicated sockets, if 
> we try in notify() create next WSocketNotify.... This I solve by adding metod 
> hasSocket(int) for check dublicated.

I think it is a missing API problem in asio: since the library allows
you to assign() a native descriptor (in an unknown state) to a socket,
it should also allow you to release() it later again, instead of
insisting on closing the native descriptor when deleting the
asio::socket.

In any case, unless you are working on a Windows platform, the current
CVS should solve these problems.

Regards,
koen

------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
witty-interest mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/witty-interest

Reply via email to