|
Boost Users : |
Subject: Re: [Boost-users] [ASIO] async_accept : Error m_val 1.
From: Cyprien DIOT (cyprien.diot_at_[hidden])
Date: 2011-03-11 03:28:49
Thank you for your help but it didn't change anything.
After few hours working on this problem, i've fix it:
In a new VS2010 project, with the same source code, this code works without any error in async_accept callback.
Finally, i find out that it didn't work because i was using pragma lib in one of my file for managing windows services:
#pragma comment (lib, "advapi32.lib")
#pragma comment (lib, "user32.lib")
When I removed this file, error disappears.
Then, I put theses lib in project's configuration instead of using pragma and everything works!
Although I don't understand the problem, it's now working.
Thank you for your help
Cyprien DIOT
----- Mail original -----
De: "Igor R" <boost.lists_at_[hidden]>
Ã: boost-users_at_[hidden]
Envoyé: Jeudi 10 Mars 2011 15:58:17
Objet: Re: [Boost-users] [ASIO] async_accept : Error m_val 1.
> What is "already open" ? _client ? It has just been allocated before calling async_accept.
> _io is properly initialized.
>
> If this error is about acceptor, how can I use it with async_accept ? I've seen http://www.boost.org/doc/libs/1_37_0/doc/html/boost_asio/reference/basic_socket_acceptor/async_accept/overload1.html but i don't see any line where the listen port is set to acceptor.
Like Viatcheslav mentioned, set reuse_address option:
http://think-async.com/Asio/boost_asio_1_5_2/doc/html/boost_asio/reference/socket_base/reuse_address.html
_______________________________________________
Boost-users mailing list
Boost-users_at_[hidden]
http://lists.boost.org/mailman/listinfo.cgi/boost-users
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net