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
9c128526
Commit
9c128526
authored
Nov 23, 2016
by
Joseph Noir
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Little bit of clean up
parent
a4ad9d7b
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
2 additions
and
42 deletions
+2
-42
libcaf_io/caf/io/system_messages.hpp
libcaf_io/caf/io/system_messages.hpp
+1
-2
libcaf_io/src/default_multiplexer.cpp
libcaf_io/src/default_multiplexer.cpp
+0
-39
libcaf_io/src/dgram_scribe.cpp
libcaf_io/src/dgram_scribe.cpp
+1
-1
No files found.
libcaf_io/caf/io/system_messages.hpp
View file @
9c128526
...
...
@@ -165,7 +165,7 @@ inspect(Inspector& f, dgram_doorman_closed_msg& x) {
return
f
(
meta
::
type_name
(
"dgram_doorman_closed_msg"
),
x
.
handle
);
}
/// Signalizes newly dis
vocer
d remote endpoint
/// Signalizes newly dis
covere
d remote endpoint
/// and the responsible scribe to a {@link broker}.
struct
new_endpoint_msg
{
// Handle to the related datagram endpoint.
...
...
@@ -191,7 +191,6 @@ struct new_datagram_msg {
dgram_scribe_handle
handle
;
// Buffer containing received data.
std
::
vector
<
char
>
buf
;
// Port of the doorman that accepted the handshake
};
/// @relates new_datagram_msg
...
...
libcaf_io/src/default_multiplexer.cpp
View file @
9c128526
...
...
@@ -1011,17 +1011,6 @@ default_multiplexer::add_dgram_doorman(abstract_broker* self,
//auto endpoint_info = acceptor_.last_sender();
auto
fd
=
new_dgram_scribe_impl
(
acceptor_
.
host
(),
acceptor_
.
port
());
/*
{
std::string host;
uint16_t port;
std::tie(host,port) = sender_from_sockaddr(endpoint_info.first,
endpoint_info.second);
std::cerr << "[DDM] New scribe with " << fd << " for " << host
<< ":" << port << "(or " << acceptor_.host() << ":"
<< acceptor_.port() << ")" << std::endl;
}
*/
if
(
!
fd
)
{
CAF_LOG_ERROR
(
CAF_ARG
(
fd
.
error
()));
return
false
;
...
...
@@ -1265,15 +1254,6 @@ bool send_datagram(size_t& result, native_socket fd, void* buf, size_t buf_len,
auto
sres
=
::
sendto
(
fd
,
reinterpret_cast
<
socket_send_ptr
>
(
buf
),
buf_len
,
no_sigpipe_flag
,
reinterpret_cast
<
sockaddr
*>
(
&
sa
),
sa_len
);
/*
{
std::string host;
uint16_t port;
std::tie(host,port) = sender_from_sockaddr(sa, sa_len);
std::cerr << "[SD] Sent " << sres << " bytes to "
<< host << ":" << port << std::endl;
}
*/
if
(
is_error
(
sres
,
true
))
{
CAF_LOG_ERROR
(
"sendto returned"
<<
CAF_ARG
(
sres
));
return
false
;
...
...
@@ -1289,15 +1269,6 @@ bool receive_datagram(size_t& result, native_socket fd, void* buf, size_t len,
auto
sres
=
::
recvfrom
(
fd
,
buf
,
len
,
0
,
reinterpret_cast
<
struct
sockaddr
*>
(
&
sa
),
&
sa_len
);
/*
{
std::string host;
uint16_t port;
std::tie(host,port) = sender_from_sockaddr(sa, sa_len);
std::cerr << "[RD] Received " << sres << " bytes from "
<< host << ":" << port << std::endl;
}
*/
// TODO: Check if sres > len and do some error handling ...
if
(
is_error
(
sres
,
true
))
{
CAF_LOG_ERROR
(
"recvfrom returned"
<<
CAF_ARG
(
sres
));
...
...
@@ -1803,8 +1774,6 @@ void dgram_acceptor::handle_event(operation op) {
CAF_LOG_TRACE
(
CAF_ARG
(
fd
())
<<
CAF_ARG
(
op
));
switch
(
op
)
{
case
operation
:
:
read
:
{
// incoming message should signify a new remote enpoint
// --> create a new dgram_scribe
// TODO: some idenfification to prevent arbitrary
// message from creating endpoints?
size_t
rb
;
...
...
@@ -1814,14 +1783,6 @@ void dgram_acceptor::handle_event(operation op) {
passivate
();
return
;
}
{
std
::
string
host
;
uint16_t
port
;
std
::
tie
(
host
,
port
)
=
sender_from_sockaddr
(
sockaddr_
,
sockaddr_len_
);
// std::cerr << "[ACC] " << fd() << " received message with " << rb
// << " bytes from " << host << ":" << port << std::endl;
}
bytes_read_
=
rb
;
if
(
rb
>
0
)
{
std
::
tie
(
host_
,
port_
)
=
sender_from_sockaddr
(
sockaddr_
,
sockaddr_len_
);
...
...
libcaf_io/src/dgram_scribe.cpp
View file @
9c128526
...
...
@@ -58,7 +58,7 @@ bool dgram_scribe::consume(execution_unit* ctx, const void*, size_t num_bytes) {
auto
result
=
invoke_mailbox_element
(
ctx
);
// swap buffer back to stream and implicitly flush wr_buf()
msg_buf
.
swap
(
buf
);
flush
();
// <-- TODO: here from scribe, not sure why?
flush
();
return
result
;
}
...
...
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