Github User Fetcher 1.0.0
C Application with Server and GUI
|
#include <errno.h>
#include <string.h>
#include <stdio.h>
#include <unistd.h>
#include <fcntl.h>
#include <netdb.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <time.h>
#include "duktape.h"
Go to the source code of this file.
Macros | |
#define | _GNU_SOURCE |
#define | ERROR_FROM_ERRNO(ctx) |
Functions | |
static void | set_nonblocking (duk_context *ctx, int fd) |
static void | set_reuseaddr (duk_context *ctx, int fd) |
static int | socket_create_server_socket (duk_context *ctx) |
static int | socket_close (duk_context *ctx) |
static int | socket_accept (duk_context *ctx) |
static int | socket_connect (duk_context *ctx) |
static int | socket_read (duk_context *ctx) |
static int | socket_write (duk_context *ctx) |
void | socket_register (duk_context *ctx) |
Variables | |
static duk_function_list_entry | socket_funcs [] |
#define _GNU_SOURCE |
Definition at line 5 of file duktape-1.8.0/examples/eventloop/socket.c.
#define ERROR_FROM_ERRNO | ( | ctx | ) |
Definition at line 19 of file duktape-1.8.0/examples/eventloop/socket.c.
Referenced by set_nonblocking(), set_reuseaddr(), socket_accept(), socket_close(), socket_connect(), socket_create_server_socket(), socket_read(), and socket_write().
|
static |
Definition at line 23 of file duktape-1.8.0/examples/eventloop/socket.c.
References ERROR_FROM_ERRNO.
Referenced by socket_accept(), socket_connect(), and socket_create_server_socket().
|
static |
Definition at line 41 of file duktape-1.8.0/examples/eventloop/socket.c.
References ERROR_FROM_ERRNO.
Referenced by socket_create_server_socket().
|
static |
Definition at line 133 of file duktape-1.8.0/examples/eventloop/socket.c.
References duk_push_int(), duk_push_object(), duk_push_sprintf(), duk_push_string(), duk_put_prop(), duk_to_int(), ERROR_FROM_ERRNO, and set_nonblocking().
|
static |
Definition at line 122 of file duktape-1.8.0/examples/eventloop/socket.c.
References duk_to_int(), and ERROR_FROM_ERRNO.
|
static |
Definition at line 174 of file duktape-1.8.0/examples/eventloop/socket.c.
References DUK_ERR_ERROR, duk_error, duk_push_int(), duk_to_int(), duk_to_string(), ERROR_FROM_ERRNO, NULL, and set_nonblocking().
|
static |
Definition at line 65 of file duktape-1.8.0/examples/eventloop/socket.c.
References DUK_ERR_ERROR, duk_error, duk_push_int(), duk_to_int(), duk_to_string(), ERROR_FROM_ERRNO, NULL, set_nonblocking(), and set_reuseaddr().
|
static |
Definition at line 231 of file duktape-1.8.0/examples/eventloop/socket.c.
References duk_push_fixed_buffer, duk_to_int(), ERROR_FROM_ERRNO, and NULL.
void socket_register | ( | duk_context * | ctx | ) |
Definition at line 279 of file duktape-1.8.0/examples/eventloop/socket.c.
References duk_pop(), duk_push_global_object(), duk_push_object(), duk_put_function_list(), duk_put_prop_string(), socket_funcs, and socket_funcs.
Referenced by main().
|
static |
Definition at line 247 of file duktape-1.8.0/examples/eventloop/socket.c.
References duk_push_int(), duk_to_buffer, duk_to_int(), ERROR_FROM_ERRNO, MSG_NOSIGNAL, and NULL.
|
static |
Definition at line 269 of file duktape-1.8.0/examples/eventloop/socket.c.
Referenced by socket_register().