Skip to content

Commit 497aaca

Browse files
committed
Update for TCPClient
1 parent 5a9d6ef commit 497aaca

2 files changed

Lines changed: 10 additions & 0 deletions

File tree

src/socket/simple_tcp/TCPClient.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,4 +74,12 @@ void TCPClient::close() {
7474
::close(client_fd_);
7575
client_fd_ = -1;
7676
}
77+
}
78+
79+
const std::string& TCPClient::getHost() const {
80+
return host_;
81+
}
82+
83+
uint16_t TCPClient::getPort() const {
84+
return port_;
7785
}

src/socket/simple_tcp/TCPClient.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ class TCPClient {
1111
void send(const std::string& msg);
1212
std::string receive();
1313

14+
const std::string& getHost() const;
15+
uint16_t getPort() const;
1416
private:
1517
std::string host_;
1618
uint16_t port_;

0 commit comments

Comments
 (0)