tildefriends/src/socket.js.h

31 lines
514 B
C
Raw Normal View History

#pragma once
/**
** \defgroup socket_js Socket Interface
** Exposes network sockets to script.
** @{
*/
#include "quickjs.h"
/**
** Register the socket script interface.
** @param context The JS context.
** @return The Socket constructor.
*/
JSValue tf_socket_register(JSContext* context);
/**
** Get the number of active socket objects.
** @return The count.
*/
int tf_socket_get_count();
/**
** Get the number of connected socket objects.
** @return the count.
*/
int tf_socket_get_open_count();
/** @} */