summaryrefslogtreecommitdiff
path: root/src/SocketCore.h
diff options
context:
space:
mode:
authorTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2016-01-09 18:16:08 +0900
committerTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2016-01-09 18:17:04 +0900
commitea4d99ea087d8f1bafa812017efa26cb90d99947 (patch)
treef2a4b2e9cbbec1a2a98d5f452a230f116c47748a /src/SocketCore.h
parente899eba76f7b8f91805176db4460f91e0a4dd487 (diff)
Refactor SocketCore::getPeerInfo, getAddrInfo to return Endpoint object
Diffstat (limited to 'src/SocketCore.h')
-rw-r--r--src/SocketCore.h19
1 files changed, 6 insertions, 13 deletions
diff --git a/src/SocketCore.h b/src/SocketCore.h
index 2f57da14..48c9c7d2 100644
--- a/src/SocketCore.h
+++ b/src/SocketCore.h
@@ -169,12 +169,9 @@ public:
void beginListen();
/**
- * Stores host address and port of this socket to addrinfo and
- * returns address family.
- *
- * @param addrinfo placeholder to store host address and port.
+ * Returns host address, family and port of this socket.
*/
- int getAddrInfo(std::pair<std::string, uint16_t>& addrinfo) const;
+ Endpoint getAddrInfo() const;
/**
* Stores address of this socket to sockaddr. len must be
@@ -191,12 +188,9 @@ public:
int getAddressFamily() const;
/**
- * Stores peer's address and port to peerinfo and returns address
- * family.
- *
- * @param peerinfo placeholder to store peer's address and port.
+ * Returns peer's address, family and port.
*/
- int getPeerInfo(std::pair<std::string, uint16_t>& peerinfo) const;
+ Endpoint getPeerInfo() const;
/**
* Accepts incoming connection on this socket.
@@ -288,9 +282,8 @@ public:
*/
void readData(void* data, size_t& len);
- ssize_t readDataFrom(
- void* data, size_t len,
- std::pair<std::string /* numerichost */, uint16_t /* port */>& sender);
+ // sender.addr will be numerihost assigned.
+ ssize_t readDataFrom(void* data, size_t len, Endpoint& sender);
#ifdef ENABLE_SSL
// Performs TLS server side handshake. If handshake is completed,