Lines Matching refs:sock
37 int sock; member
47 int sock; in nbd_open() local
60 sock = unix_socket_outgoing(unixpath); in nbd_open()
79 sock = tcp_socket_outgoing(hostname, port); in nbd_open()
82 if (sock == -1) in nbd_open()
85 ret = nbd_receive_negotiate(sock, &size, &blocksize); in nbd_open()
89 s->sock = sock; in nbd_open()
108 if (nbd_send_request(s->sock, &request) == -1) in nbd_read()
111 if (nbd_receive_reply(s->sock, &reply) == -1) in nbd_read()
120 if (nbd_wr_sync(s->sock, buf, request.len, 1) != request.len) in nbd_read()
138 if (nbd_send_request(s->sock, &request) == -1) in nbd_write()
141 if (nbd_wr_sync(s->sock, (uint8_t*)buf, request.len, 0) != request.len) in nbd_write()
144 if (nbd_receive_reply(s->sock, &reply) == -1) in nbd_write()
165 nbd_send_request(s->sock, &request); in nbd_close()
167 close(s->sock); in nbd_close()