Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
actor-incubator
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
cpp-libs
actor-incubator
Commits
1970a800
Commit
1970a800
authored
Aug 07, 2019
by
Joseph Noir
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove non-blocking connect
parent
8e1541ee
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
5 deletions
+2
-5
libcaf_net/src/tcp.cpp
libcaf_net/src/tcp.cpp
+2
-5
No files found.
libcaf_net/src/tcp.cpp
View file @
1970a800
...
...
@@ -107,8 +107,7 @@ caf::expected<socket> new_ip_acceptor_impl(uint16_t port, const char* addr,
}
template
<
int
Family
>
bool
ip_connect
(
socket
fd
,
const
std
::
string
&
host
,
uint16_t
port
,
bool
nonblock
=
true
)
{
bool
ip_connect
(
socket
fd
,
const
std
::
string
&
host
,
uint16_t
port
)
{
CAF_LOG_TRACE
(
"Family ="
<<
(
Family
==
AF_INET
?
"AF_INET"
:
"AF_INET6"
)
<<
CAF_ARG
(
fd
.
id
)
<<
CAF_ARG
(
host
));
static_assert
(
Family
==
AF_INET
||
Family
==
AF_INET6
,
"invalid family"
);
...
...
@@ -120,8 +119,7 @@ bool ip_connect(socket fd, const std::string& host, uint16_t port,
family_of
(
sa
)
=
Family
;
port_of
(
sa
)
=
htons
(
port
);
using
sa_ptr
=
const
sockaddr
*
;
return
::
connect
(
fd
.
id
,
reinterpret_cast
<
sa_ptr
>
(
&
sa
),
sizeof
(
sa
))
==
0
||
(
nonblock
&&
errno
==
EINPROGRESS
);
return
::
connect
(
fd
.
id
,
reinterpret_cast
<
sa_ptr
>
(
&
sa
),
sizeof
(
sa
))
==
0
;
}
}
// namespace
...
...
@@ -181,7 +179,6 @@ expected<stream_socket> tcp::make_connected_socket(std::string host,
CAF_NET_SYSCALL
(
"socket"
,
fd
,
==
,
-
1
,
::
socket
(
proto
==
ip
::
v4
?
AF_INET
:
AF_INET6
,
socktype
,
0
));
child_process_inherit
(
fd
,
false
);
nonblocking
(
fd
,
true
);
socket_guard
sguard
(
fd
);
if
(
proto
==
ip
::
v6
)
{
if
(
ip_connect
<
AF_INET6
>
(
fd
,
res
->
first
,
port
))
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment