Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
L
libzmq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
libzmq
Commits
11fec367
Commit
11fec367
authored
Jan 05, 2010
by
malosek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added pending event fd handling by the pgm_sender
parent
472ddf8d
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
17 additions
and
5 deletions
+17
-5
pgm_sender.cpp
src/pgm_sender.cpp
+8
-1
pgm_sender.hpp
src/pgm_sender.hpp
+1
-0
pgm_socket.cpp
src/pgm_socket.cpp
+7
-3
pgm_socket.hpp
src/pgm_socket.hpp
+1
-1
No files found.
src/pgm_sender.cpp
View file @
11fec367
...
...
@@ -54,6 +54,8 @@ int zmq::pgm_sender_t::init (bool udp_encapsulation_, const char *network_)
out_buffer_size
=
pgm_socket
.
get_max_tsdu_size
();
out_buffer
=
(
unsigned
char
*
)
malloc
(
out_buffer_size
);
zmq_assert
(
out_buffer
);
return
rc
;
}
void
zmq
::
pgm_sender_t
::
plug
(
i_inout
*
inout_
)
...
...
@@ -62,20 +64,24 @@ void zmq::pgm_sender_t::plug (i_inout *inout_)
int
downlink_socket_fd
=
0
;
int
uplink_socket_fd
=
0
;
int
rdata_notify_fd
=
0
;
int
pending_notify_fd
=
0
;
encoder
.
set_inout
(
inout_
);
// Fill fds from PGM transport and add them to the poller.
pgm_socket
.
get_sender_fds
(
&
downlink_socket_fd
,
&
uplink_socket_fd
,
&
rdata_notify_fd
);
&
rdata_notify_fd
,
&
pending_notify_fd
);
handle
=
add_fd
(
downlink_socket_fd
);
uplink_handle
=
add_fd
(
uplink_socket_fd
);
rdata_notify_handle
=
add_fd
(
rdata_notify_fd
);
pending_notify_handle
=
add_fd
(
pending_notify_fd
);
// Set POLLIN. We wont never want to stop polling for uplink = we never
// want to stop porocess NAKs.
set_pollin
(
uplink_handle
);
set_pollin
(
rdata_notify_handle
);
set_pollin
(
pending_notify_handle
);
// Set POLLOUT for downlink_socket_handle.
set_pollout
(
handle
);
...
...
@@ -86,6 +92,7 @@ void zmq::pgm_sender_t::unplug ()
rm_fd
(
handle
);
rm_fd
(
uplink_handle
);
rm_fd
(
rdata_notify_handle
);
rm_fd
(
pending_notify_handle
);
encoder
.
set_inout
(
NULL
);
}
...
...
src/pgm_sender.hpp
View file @
11fec367
...
...
@@ -72,6 +72,7 @@ namespace zmq
handle_t
handle
;
handle_t
uplink_handle
;
handle_t
rdata_notify_handle
;
handle_t
pending_notify_handle
;
// Output buffer from pgm_socket.
unsigned
char
*
out_buffer
;
...
...
src/pgm_socket.cpp
View file @
11fec367
...
...
@@ -375,13 +375,15 @@ void zmq::pgm_socket_t::get_receiver_fds (int *receive_fd_,
// sender_fd is from pgm_transport->send_sock.
// receive_fd_ is from transport->recv_sock.
// rdata_notify_fd_ is from transport->rdata_notify.
// pending_notify_fd_ is from transport->pending_notify.
void
zmq
::
pgm_socket_t
::
get_sender_fds
(
int
*
send_fd_
,
int
*
receive_fd_
,
int
*
rdata_notify_fd_
)
int
*
rdata_notify_fd_
,
int
*
pending_notify_fd_
)
{
zmq_assert
(
send_fd_
);
zmq_assert
(
receive_fd_
);
zmq_assert
(
rdata_notify_fd_
);
zmq_assert
(
pending_notify_fd_
);
// recv_sock2 should not be used - check it.
zmq_assert
(
transport
->
recv_sock2
==
-
1
);
...
...
@@ -390,10 +392,12 @@ void zmq::pgm_socket_t::get_sender_fds (int *send_fd_, int *receive_fd_,
zmq_assert
(
transport
->
can_send_data
);
zmq_assert
(
!
transport
->
can_recv_data
);
// Take FDs directly from transport.
// Take FDs from transport.
*
send_fd_
=
pgm_transport_get_send_fd
(
transport
);
*
receive_fd_
=
pgm_transport_get_recv_fd
(
transport
);
*
rdata_notify_fd_
=
pgm_transport_get_repair_fd
(
transport
);
*
send_fd_
=
pgm_transport_get_send
_fd
(
transport
);
*
pending_notify_fd_
=
pgm_transport_get_pending
_fd
(
transport
);
}
// Send one APDU, transmit window owned memory.
...
...
src/pgm_socket.hpp
View file @
11fec367
...
...
@@ -56,7 +56,7 @@ namespace zmq
// Get sender and receiver fds and store it to user allocated
// memory. Receive fd is used to process NAKs from peers.
void
get_sender_fds
(
int
*
send_fd_
,
int
*
receive_fd_
,
int
*
rdata_notify_fd_
);
int
*
rdata_notify_fd_
,
int
*
pending_notify_fd_
);
// Send data as one APDU, transmit window owned memory.
size_t
send
(
unsigned
char
*
data_
,
size_t
data_len_
);
...
...
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