mirror of
https://github.com/scylladb/scylladb.git
synced 2026-05-02 14:15:46 +00:00
Add file_desc::connect()
Signed-off-by: Takuya ASADA <syuu@cloudius-systems.com>
This commit is contained in:
@@ -196,6 +196,13 @@ public:
|
||||
auto r = ::bind(_fd, &sa, sl);
|
||||
throw_system_error_on(r == -1);
|
||||
}
|
||||
void connect(sockaddr& sa, socklen_t sl) {
|
||||
auto r = ::connect(_fd, &sa, sl);
|
||||
if (r == -1 && errno == EINPROGRESS) {
|
||||
return;
|
||||
}
|
||||
throw_system_error_on(r == -1);
|
||||
}
|
||||
socket_address get_address() {
|
||||
socket_address addr;
|
||||
auto len = (socklen_t) sizeof(addr.u.sas);
|
||||
|
||||
Reference in New Issue
Block a user