diff options
author | Alex Xu (Hello71) <alex_y_xu@yahoo.ca> | 2016-07-02 22:45:40 -0400 |
---|---|---|
committer | Alex Xu (Hello71) <alex_y_xu@yahoo.ca> | 2016-07-02 22:45:40 -0400 |
commit | 132b3161f97c9d3bb08b5f001efc4cae6adc109d (patch) | |
tree | f511d0a3ebe58dca0ee48825e768fa4edefbd6ed | |
parent | 86799647b1afbaa0df36718b216efd876ffd2627 (diff) | |
download | udpastcp-132b3161f97c9d3bb08b5f001efc4cae6adc109d.tar.xz udpastcp-132b3161f97c9d3bb08b5f001efc4cae6adc109d.zip |
Re-fix timeouts, adjust comments.
-rw-r--r-- | src/client.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/client.c b/src/client.c index 71edf3e..c29d733 100644 --- a/src/client.c +++ b/src/client.c @@ -128,7 +128,7 @@ static void c_sock_cleanup(EV_P_ struct o_c_sock *sock, int stopping) { .th_flags = sock->status == TCP_ESTABLISHED ? TH_FIN : TH_RST }; - ssize_t sz = send(sock->rsock->c_data->s_sock, &buf, sizeof(buf), 0); + ssize_t sz = send(sock->rsock->fd, &buf, sizeof(buf), 0); if (sz < 0) { perror("send"); ev_break(EV_A_ EVBREAK_ONE); @@ -260,10 +260,10 @@ static void cc_cb(struct ev_loop *loop, ev_io *w, int revents __attribute__((unu free(sock->pending_data); ev_timer_stop(EV_A_ &sock->tm_w); - // 10 minutes. this is not very important because UDP packets will not - // be lost (any more), only delayed until a new connection is established. - // however, it is probably a good idea to set this higher than the UDP - // ping delay if you are using one. + // this delay is not very important because one, it is OK if UDP + // packets are lost, and two, they are only delayed until a new + // connection is established. however, it is probably a good idea to + // set this higher than the UDP ping delay if you are using one. ev_timer_init(&sock->tm_w, c_tm_cb, 10. * 60., 10. * 60.); ev_timer_start(EV_A_ &sock->tm_w); } |