[zeromq-dev] Implementing UDP and changing socket event handler.

Noh, Jangho jangho.noh at wustl.edu
Thu Jan 14 10:08:35 CET 2016


Hello folks,

I'm trying to implement UDP transport in ZMQ using Lindley French's previous work.
(https://zeromq.jira.com/browse/LIBZMQ-589)

When POLLOUT is fired on the socket. The out_event function in io_object.cpp is called and it makes error saying below messages

Assertion failed: false (src/io_object.cpp:116)
Aborted (core dumped)

void zmq::io_object_t::out_event ()
{
    zmq_assert (false);
}

What I want to do is to call out_event function in udp_sender.cpp instead of one in io_object.cpp
How can I change event handler for POLLOUT?

The below is part of source code of udp_sender.cpp. Using set_pollout function seems not working

void zmq::udp_sender_t::plug (io_thread_t *io_thread_, session_base_t *session_)
{

...
    socket_handle = add_fd (socket);
    set_pollout (socket_handle);

...

}


I traced function calls and below is the log. First string is the file name and the second string after ':' is the function name.

After "poller_base.cpp: execute_timers", out_event is called. And the program is aborted.

zmq.cpp: zmq_sendmsg
zmq.cpp: zmq_msg_send
zmq.cpp: s_sendmsg
zmq.cpp: zmq_msg_size
signaler.cpp: wait
signaler.cpp: recv
object.cpp: process_command: socket_base.cpp: process_commands : process all available commands
plug
object.cpp: process_command: poller_base.cpp: get_load
own
signaler.cpp: wait
session_base.cpp: start_connecting: UDP sender call
socket_base.cpp: send: try to send the message: 0x7ffee6dd17e0
xpub.cpp: xsend
xpub.cpp: mark_as_matching
io_object.cpp: plug
v1_encoder.cpp: v1_encoder_t
udp_sender.cpp: udp_sender_t
udp_sender.cpp: init
ip.cpp: open_socket: 10 2 17
io_thread.cpp: unblock_socket
object.cpp: process_command: attach
session_base.cpp: process_attach
udp_sender.cpp: plug
poller_base.cpp: adjust_load
signaler.cpp: wait
poller_base.cpp: execute_timers
io_object.cpp: out_event


Appreciate your help.


Sincerely,

Jangho Noh

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20160114/00da5a66/attachment.htm>


More information about the zeromq-dev mailing list