You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thank you for your efforts on this library. It's a lot of work.
This is not really a bug report, it could be seems as a feature request, or more likely, it's a call for advice.
I'm trying to use libutp in a multi-thread applications with multiple UTP communication over a single UDP socket. I have read the warning in the paragraph Interface of the readme.
Hello,
Thank you for your efforts on this library. It's a lot of work.
This is not really a bug report, it could be seems as a feature request, or more likely, it's a call for advice.
I'm trying to use libutp in a multi-thread applications with multiple UTP communication over a single UDP socket. I have read the warning in the paragraph Interface of the readme.
I have one instance of:
`
socketUDP = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP);
bind(socketUDP, (struct sockaddr*)(&si_me), sizeof(si_me));
ctx = utp_init(2);
utp_set_callback(ctx, ...);
struct pollfd pollfds[1];
pollfds[0].fd = socketUDP;
pollfds[0].events = POLLIN;
while (1) {
poll(pollfds, 1, -1);
if (pollfds[0].revents & POLLIN) {
recvfrom(socketUDP,
utp_process_udp(ctx, socket_data, len, (struct sockaddr *)&src_addr, addrlen);
}
}
`
I have multiple instances from different threads:
utp_socket *sock = utp_create_socket(ctx); utp_connect(sock, (struct sockaddr *)&sin, sizeof(sin)); utp_write(sock, ...);
I have in place a system NOT to mix the different 'write' buffers.
Nevertheless, the library doesn't like it and I get crashes especially when utp_write happen at the same time.
Is there an example or a paper suggesting how to use libutp in a multi-thread app?
The text was updated successfully, but these errors were encountered: