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
27854299
Commit
27854299
authored
Apr 24, 2012
by
neverlord
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
better diagnostic
parent
f2e3753e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
12 deletions
+6
-12
src/mailman.cpp
src/mailman.cpp
+5
-11
src/post_office.cpp
src/post_office.cpp
+1
-1
No files found.
src/mailman.cpp
View file @
27854299
...
@@ -120,17 +120,11 @@ void mailman_loop()
...
@@ -120,17 +120,11 @@ void mailman_loop()
DEBUG
(
"--> "
<<
to_string
(
sjob
.
msg
));
DEBUG
(
"--> "
<<
to_string
(
sjob
.
msg
));
// write size of serialized message
// write size of serialized message
auto
sent
=
::
send
(
peer
,
&
size32
,
sizeof
(
std
::
uint32_t
),
0
);
auto
sent
=
::
send
(
peer
,
&
size32
,
sizeof
(
std
::
uint32_t
),
0
);
if
(
sent
>
0
)
if
(
sent
!=
static_cast
<
int
>
(
sizeof
(
std
::
uint32_t
))
||
static_cast
<
int
>
(
bs
.
size
())
!=
::
send
(
peer
,
bs
.
data
(),
bs
.
size
(),
0
))
{
{
// write message
disconnect_peer
=
true
;
sent
=
::
send
(
peer
,
bs
.
data
(),
bs
.
size
(),
0
);
DEBUG
(
"too few bytes written"
);
}
// disconnect peer if send() failed
disconnect_peer
=
(
sent
<=
0
);
// make sure all bytes are written
if
(
static_cast
<
std
::
uint32_t
>
(
sent
)
!=
size32
)
{
throw
std
::
logic_error
(
"send() not a synchronous socket"
);
}
}
}
}
// something went wrong; close connection to this peer
// something went wrong; close connection to this peer
...
@@ -166,7 +160,7 @@ void mailman_loop()
...
@@ -166,7 +160,7 @@ void mailman_loop()
}
}
else
else
{
{
// TODO: some kind of error handling?
DEBUG
(
"add_peer_job failed: peer already known"
);
}
}
}
}
else
if
(
job
->
is_kill_job
())
else
if
(
job
->
is_kill_job
())
...
...
src/post_office.cpp
View file @
27854299
...
@@ -747,7 +747,7 @@ void post_office_loop(int pipe_read_handle, int pipe_write_handle)
...
@@ -747,7 +747,7 @@ void post_office_loop(int pipe_read_handle, int pipe_write_handle)
for
(
po_peer
&
pd
:
peers
)
for
(
po_peer
&
pd
:
peers
)
{
{
auto
fd
=
pd
.
get_socket
();
auto
fd
=
pd
.
get_socket
();
if
(
fd
>
maxfd
)
maxfd
=
fd
;
maxfd
=
std
::
max
(
maxfd
,
fd
)
;
FD_SET
(
fd
,
&
readset
);
FD_SET
(
fd
,
&
readset
);
}
}
// iterate over key-value (actor id / doormen) pairs
// iterate over key-value (actor id / doormen) pairs
...
...
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