summaryrefslogtreecommitdiff
path: root/src/SocketCore.cc
diff options
context:
space:
mode:
authorTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2012-11-15 21:09:10 +0900
committerTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2012-11-15 21:09:10 +0900
commit6b2f5ab1f57d20e467d3e839a18723a48d87006e (patch)
treeaa209d72bf900115ce8d9541ac039b679ef4e767 /src/SocketCore.cc
parentb2893f1e31ca91f5051de211a3323ada2c160c78 (diff)
SocketCore::bind now accepts const char* host instead of std::string
Diffstat (limited to 'src/SocketCore.cc')
-rw-r--r--src/SocketCore.cc10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/SocketCore.cc b/src/SocketCore.cc
index 2ee26e46..aa2e6490 100644
--- a/src/SocketCore.cc
+++ b/src/SocketCore.cc
@@ -287,15 +287,15 @@ void SocketCore::bindWithFamily(uint16_t port, int family, int flags)
}
void SocketCore::bind
-(const std::string& addr, uint16_t port, int family, int flags)
+(const char* addr, uint16_t port, int family, int flags)
{
closeConnection();
std::string error;
const char* addrp;
- if(addr.empty()) {
- addrp = 0;
+ if(addr && addr[0]) {
+ addrp = addr;
} else {
- addrp = addr.c_str();
+ addrp = 0;
}
if(!(flags&AI_PASSIVE) || bindAddrs_.empty()) {
sock_t fd = bindTo(addrp, port, family, sockType_, flags, error);
@@ -332,7 +332,7 @@ void SocketCore::bind
void SocketCore::bind(uint16_t port, int flags)
{
- bind(A2STR::NIL, port, protocolFamily_, flags);
+ bind(0, port, protocolFamily_, flags);
}
void SocketCore::bind(const struct sockaddr* addr, socklen_t addrlen)