Sha256: 4cdbdc93b310043b61ff15cb45e56da55eb0cde16c9ef0f94b5708f630d4de8f

Contents?: true

Size: 917 Bytes

Versions: 136

Compression:

Stored size: 917 Bytes

Contents

/*
 * Copyright (c) 2004-2005 Sergey Lyubka <valenok@gmail.com>
 * All rights reserved
 *
 * "THE BEER-WARE LICENSE" (Revision 42):
 * Sergey Lyubka wrote this file.  As long as you retain this notice you
 * can do whatever you want with this stuff. If we meet some day, and you think
 * this stuff is worth it, you can buy me a beer in return.
 */

#include "defs.h"

static int
read_socket(struct stream *stream, void *buf, size_t len)
{
	assert(stream->chan.sock != -1);
	return (recv(stream->chan.sock, buf, len, 0));
}

static int
write_socket(struct stream *stream, const void *buf, size_t len)
{
	assert(stream->chan.sock != -1);
	return (send(stream->chan.sock, buf, len, 0));
}

static void
close_socket(struct stream *stream)
{
	assert(stream->chan.sock != -1);
	(void) closesocket(stream->chan.sock);
}

const struct io_class	_shttpd_io_socket =  {
	"socket",
	read_socket,
	write_socket,
	close_socket
};

Version data entries

136 entries across 136 versions & 2 rubygems

Version Path
rhodes-7.6.0 platform/shared/shttpd/src/io_socket.c
rhodes-7.5.1 platform/shared/shttpd/src/io_socket.c
rhodes-7.4.1 platform/shared/shttpd/src/io_socket.c
rhodes-7.1.17 platform/shared/shttpd/src/io_socket.c
rhodes-6.2.0 platform/shared/shttpd/src/io_socket.c
rhodes-6.0.11 platform/shared/shttpd/src/io_socket.c
rhodes-5.5.18 platform/shared/shttpd/src/io_socket.c
rhodes-5.5.17 platform/shared/shttpd/src/io_socket.c
rhodes-5.5.15 platform/shared/shttpd/src/io_socket.c
rhodes-5.5.0.22 platform/shared/shttpd/src/io_socket.c
rhodes-5.5.2 platform/shared/shttpd/src/io_socket.c
rhodes-5.5.0.7 platform/shared/shttpd/src/io_socket.c
rhodes-5.5.0.3 platform/shared/shttpd/src/io_socket.c
rhodes-5.5.0 platform/shared/shttpd/src/io_socket.c
tauplatform-1.0.3 platform/shared/shttpd/src/io_socket.c
tauplatform-1.0.2 platform/shared/shttpd/src/io_socket.c
tauplatform-1.0.1 platform/shared/shttpd/src/io_socket.c
rhodes-3.5.1.12 platform/shared/shttpd/src/io_socket.c
rhodes-3.3.5 platform/shared/shttpd/src/io_socket.c
rhodes-3.4.2 platform/shared/shttpd/src/io_socket.c