void do_accept(struct utcp_connection *nc, uint16_t port) {
utcp_accept(nc, do_recv, NULL);
c = nc;
+ utcp_set_accept_cb(c->utcp, NULL, NULL);
}
ssize_t do_send(struct utcp *utcp, const void *data, size_t len) {
char buf[102400];
struct timeval timeout = utcp_timeout(u);
- while(dir) {
+ while(!connected || utcp_is_active(u)) {
size_t max = c ? utcp_get_sndbuf_free(c) : 0;
if(max > sizeof buf)
max = sizeof buf;