module_socket.c File Reference

Lightweight, low-level wrapper around the standard Berkley sockets API. More...

#include <string.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <arpa/inet.h>
#include <netdb.h>
#include <errno.h>
#include <kuroko/vm.h>
#include <kuroko/util.h>
Include dependency graph for module_socket.c:

Go to the source code of this file.

Data Structures

struct  socket


#define IS_socket(o)   (krk_isInstanceOf(o,SocketClass))
#define AS_socket(o)   ((struct socket*)AS_OBJECT(o))
#define CURRENT_CTYPE   struct socket *
#define CURRENT_NAME   self
#define SOCK_CONST(o)   krk_attachNamedValue(&module->fields, #o, INTEGER_VAL(o));


KrkValue _socket___init__ (int, KrkValue *, int)
KrkValue _socket___repr__ (int, KrkValue *, int)
KrkValue _socket_connect (int, KrkValue *, int)
KrkValue _socket_bind (int, KrkValue *, int)
KrkValue _socket_listen (int, KrkValue *, int)
KrkValue _socket_accept (int, KrkValue *, int)
KrkValue _socket_shutdown (int, KrkValue *, int)
KrkValue _socket_recv (int, KrkValue *, int)
KrkValue _socket_send (int, KrkValue *, int)
KrkValue _socket_sendto (int, KrkValue *, int)
KrkValue _socket_fileno (int, KrkValue *, int)
KrkValue _socket_setsockopt (int, KrkValue *, int)
KrkValue _krk_htons (int, KrkValue *, int)
KrkValue _socket_family (int, KrkValue *, int)
KrkValue _socket_type (int, KrkValue *, int)
KrkValue _socket_proto (int, KrkValue *, int)
KrkValue krk_module_onload_socket (void)

Detailed Description

Lightweight, low-level wrapper around the standard Berkley sockets API.

K. Lange

Definition in file module_socket.c.

Function Documentation

◆ krk_module_onload_socket()

KrkValue krk_module_onload_socket ( void  )

AF_ constants Taken from the manpages for Linux, and all shoved behind ifdefs, so this should build fine on most anything even if most of these aren't widely supported by other platforms.

Definition at line 516 of file module_socket.c.