equal
deleted
inserted
replaced
45 want_read = false; |
45 want_read = false; |
46 want_write = false; |
46 want_write = false; |
47 } |
47 } |
48 |
48 |
49 void NetworkSocket::lazy_socket (int family, int socktype, int protocol) { |
49 void NetworkSocket::lazy_socket (int family, int socktype, int protocol) { |
50 // if we already have a socket, exit |
50 // if we already have a socket, good |
|
51 // XXX: should we check family/socktype/protocol against sock_type? |
51 if (fd >= 0) |
52 if (fd >= 0) |
52 return; |
53 return; |
53 |
54 |
54 // ignore if we've requested a specific sock_type |
55 // ignore if we've requested a specific sock_type |
55 if ( |
56 if ( |
246 } |
247 } |
247 |
248 |
248 // EAGAIN? |
249 // EAGAIN? |
249 if (ret < 0) { |
250 if (ret < 0) { |
250 // set want_write so we get a sig_write |
251 // set want_write so we get a sig_write |
251 want_write = true; |
252 // XXX: this is the job of the user |
|
253 // want_write = true; |
252 |
254 |
253 return 0; |
255 return 0; |
254 } |
256 } |
255 |
257 |
256 // return number of bytes sent |
258 // return number of bytes sent |