Boost logo

Boost Users :

Subject: Re: [Boost-users] boost bind conflicting with socket bind
From: Peter Dimov (pdimov_at_[hidden])
Date: 2008-10-29 14:51:40


Sharad Mittal:

> Hello,
> My Socket code that contains call to "bind" to a port is conflicting with
> boost::bind in 1.36. It compiles fine under boost 1.34 and 1.35.
> Interestingly, nothing is included from boost in that file. I am using
> boost with mingw on Win Xp.
>
> The code snippet is as follows:
...

> if (bind(s_, (sockaddr *)&sa, sizeof(sockaddr_in)) == SOCKET_ERROR) {

I don't know why this call chooses to call boost::bind instead of the socket
bind; it may have something to do with the type of s_.

Either way, you should be able to fix it by using ::bind instead of just
bind.

--
Peter Dimov
http://www.pdplayer.com 

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