2 * Copyright (c) 2004-2005 Sergey Lyubka <valenok@gmail.com>
5 * "THE BEER-WARE LICENSE" (Revision 42):
6 * Sergey Lyubka wrote this file. As long as you retain this notice you
7 * can do whatever you want with this stuff. If we meet some day, and you think
8 * this stuff is worth it, you can buy me a beer in return.
14 read_socket(struct stream *stream, void *buf, size_t len)
16 assert(stream->chan.sock != -1);
17 return (recv(stream->chan.sock, buf, len, 0));
21 write_socket(struct stream *stream, const void *buf, size_t len)
23 assert(stream->chan.sock != -1);
24 return (send(stream->chan.sock, buf, len, 0));
28 close_socket(struct stream *stream)
30 assert(stream->chan.sock != -1);
31 (void) closesocket(stream->chan.sock);
34 const struct io_class io_socket = {