summaryrefslogtreecommitdiff
path: root/src/SocketCore.h
diff options
context:
space:
mode:
authorTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2008-02-20 13:02:48 +0000
committerTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2008-02-20 13:02:48 +0000
commit2cc471ebf6600f11c6af07e4e968778c2c470b0b (patch)
tree240c13bf954e4286856490e615f78d238c63f925 /src/SocketCore.h
parent4708809094a67fd75276aed2794f14274f1122e6 (diff)
2008-02-20 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
IPv6 support for SocketCore class. TODO: In SocketCore::establishConnection(), this is insufficient to determin the failure of connect() here because the socket is non-blocking state. The next addresses should be tried after select(). TODO: NameResolver still uses c-ares(<= 1.4) ares_gethostbyname(). If c-ares 1.5 or newer is installed, ares_getaddrinfo() should be used instead which address family independent. TODO: DHTRoutingTable{Deserializer,Serializer} currently saves peer information in a compact peer format which is for IPv4 only. Some BitTorrent functions in PeerMessageUtil still depends on IPv4 but this is a spec of BitTorrent protocol. * src/SocketCore.{h, cc} * src/PeerMessageUtil.cc * test/SocketCoreTest.cc * test/PeerMessageUtilTest.cc * test/DHTConnectionImplTest.cc Handle IPv4-mapped addresses. * src/DHTNode.cc: Now identity is determined by node id. * src/DHTMessageTrackerEntry.cc Because now PeerMessageUtil::unpackcompact() could fail, the caller should handle it. * src/DHTRoutingTableDeserializer.cc * src/DHTMessageFactoryImpl.cc
Diffstat (limited to 'src/SocketCore.h')
-rw-r--r--src/SocketCore.h8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/SocketCore.h b/src/SocketCore.h
index 77f71428..774ccab3 100644
--- a/src/SocketCore.h
+++ b/src/SocketCore.h
@@ -87,6 +87,9 @@ private:
static int error();
static const char *errorMsg();
static const char *errorMsg(const int err);
+
+ static std::pair<std::string, uint16_t>
+ getNameInfoInNumeric(const struct sockaddr* sockaddr, socklen_t len);
public:
SocketCore(int sockType = SOCK_STREAM);
~SocketCore();
@@ -206,15 +209,10 @@ public:
readData(reinterpret_cast<char*>(data), len);
}
- ssize_t readDataFrom(char* data, size_t len, struct sockaddr* sender,
- socklen_t* senderLength);
-
ssize_t readDataFrom(char*, size_t len,
std::pair<std::string /* numerichost */,
uint16_t /* port */>& sender);
- ssize_t readDataFrom(char* data, size_t len);
-
/**
* Reads up to len bytes from this socket, but bytes are not removed from
* this socket.