diff options
Diffstat (limited to 'src/net_udp.c')
-rw-r--r-- | src/net_udp.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/net_udp.c b/src/net_udp.c index 03e0ae1..685e609 100644 --- a/src/net_udp.c +++ b/src/net_udp.c @@ -61,7 +61,7 @@ static int perf__udp_sockready(struct perf_net_socket* sock, int pipe_fd, int64_ return 1; } -struct perf_net_socket* perf_net_udp_opensocket(const perf_sockaddr_t* server, const perf_sockaddr_t* local, size_t bufsize) +struct perf_net_socket* perf_net_udp_opensocket(const perf_sockaddr_t* server, const perf_sockaddr_t* local, size_t bufsize, void* data, perf_net_sent_cb_t sent, perf_net_event_cb_t event) { struct perf__udp_socket* tmp = calloc(1, sizeof(struct perf__udp_socket)); // clang scan-build struct perf_net_socket* sock = (struct perf_net_socket*)tmp; @@ -79,6 +79,10 @@ struct perf_net_socket* perf_net_udp_opensocket(const perf_sockaddr_t* server, c sock->sockeq = perf__udp_sockeq; sock->sockready = perf__udp_sockready; + sock->data = data; + sock->sent = sent; + sock->event = event; + sock->fd = socket(server->sa.sa.sa_family, SOCK_DGRAM, 0); if (sock->fd == -1) { char __s[256]; |