Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
Actor Framework
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
Operations
Operations
Metrics
Environments
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 Framework
Commits
740cdaf3
Commit
740cdaf3
authored
Nov 14, 2019
by
Dominik Charousset
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix formatting
parent
50bb5ed3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
23 deletions
+25
-23
libcaf_io/caf/io/network/native_socket.hpp
libcaf_io/caf/io/network/native_socket.hpp
+25
-23
No files found.
libcaf_io/caf/io/network/native_socket.hpp
View file @
740cdaf3
...
...
@@ -18,8 +18,8 @@
#pragma once
#include <string>
#include <cstdint>
#include <string>
#include "caf/config.hpp"
#include "caf/detail/io_export.hpp"
...
...
@@ -31,17 +31,17 @@ namespace network {
// Annoying platform-dependent bootstrapping.
#ifdef CAF_WINDOWS
using
setsockopt_ptr
=
const
char
*
;
using
getsockopt_ptr
=
char
*
;
using
socket_send_ptr
=
const
char
*
;
using
socket_recv_ptr
=
char
*
;
using
socket_size_type
=
int
;
using
setsockopt_ptr
=
const
char
*
;
using
getsockopt_ptr
=
char
*
;
using
socket_send_ptr
=
const
char
*
;
using
socket_recv_ptr
=
char
*
;
using
socket_size_type
=
int
;
#else
using
setsockopt_ptr
=
const
void
*
;
using
getsockopt_ptr
=
void
*
;
using
socket_send_ptr
=
const
void
*
;
using
socket_recv_ptr
=
void
*
;
using
socket_size_type
=
unsigned
;
using
setsockopt_ptr
=
const
void
*
;
using
getsockopt_ptr
=
void
*
;
using
socket_send_ptr
=
const
void
*
;
using
socket_recv_ptr
=
void
*
;
using
socket_size_type
=
unsigned
;
#endif
using
signed_size_type
=
std
::
make_signed
<
size_t
>::
type
;
...
...
@@ -53,17 +53,17 @@ CAF_IO_EXPORT extern const int no_sigpipe_socket_flag;
CAF_IO_EXPORT
extern
const
int
no_sigpipe_io_flag
;
#ifdef CAF_WINDOWS
using
native_socket
=
size_t
;
constexpr
native_socket
invalid_native_socket
=
static_cast
<
native_socket
>
(
-
1
);
inline
int64_t
int64_from_native_socket
(
native_socket
sock
)
{
return
sock
==
invalid_native_socket
?
-
1
:
static_cast
<
int64_t
>
(
sock
);
}
using
native_socket
=
size_t
;
constexpr
native_socket
invalid_native_socket
=
static_cast
<
native_socket
>
(
-
1
);
inline
int64_t
int64_from_native_socket
(
native_socket
sock
)
{
return
sock
==
invalid_native_socket
?
-
1
:
static_cast
<
int64_t
>
(
sock
);
}
#else
using
native_socket
=
int
;
constexpr
native_socket
invalid_native_socket
=
-
1
;
inline
int64_t
int64_from_native_socket
(
native_socket
sock
)
{
return
static_cast
<
int64_t
>
(
sock
);
}
using
native_socket
=
int
;
constexpr
native_socket
invalid_native_socket
=
-
1
;
inline
int64_t
int64_from_native_socket
(
native_socket
sock
)
{
return
static_cast
<
int64_t
>
(
sock
);
}
#endif
/// Returns the last socket error as an integer.
...
...
@@ -90,7 +90,8 @@ CAF_IO_EXPORT std::pair<native_socket, native_socket> create_pipe();
/// Sets fd to be inherited by child processes if `new_value == true`
/// or not if `new_value == false`. Not implemented on Windows.
/// throws `network_error` on error
CAF_IO_EXPORT
expected
<
void
>
child_process_inherit
(
native_socket
fd
,
bool
new_value
);
CAF_IO_EXPORT
expected
<
void
>
child_process_inherit
(
native_socket
fd
,
bool
new_value
);
/// Enables keepalive on `fd`. Throws `network_error` on error.
CAF_IO_EXPORT
expected
<
void
>
keepalive
(
native_socket
fd
,
bool
new_value
);
...
...
@@ -108,7 +109,8 @@ CAF_IO_EXPORT expected<void> tcp_nodelay(native_socket fd, bool new_value);
CAF_IO_EXPORT
expected
<
void
>
allow_sigpipe
(
native_socket
fd
,
bool
new_value
);
/// Enables or disables `SIO_UDP_CONNRESET`error on `fd`.
CAF_IO_EXPORT
expected
<
void
>
allow_udp_connreset
(
native_socket
fd
,
bool
new_value
);
CAF_IO_EXPORT
expected
<
void
>
allow_udp_connreset
(
native_socket
fd
,
bool
new_value
);
/// Get the socket buffer size for `fd`.
CAF_IO_EXPORT
expected
<
int
>
send_buffer_size
(
native_socket
fd
);
...
...
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