2021-01-02 13:10:00 -05:00
|
|
|
#pragma once
|
|
|
|
|
2024-02-20 21:41:37 -05:00
|
|
|
/**
|
|
|
|
** \defgroup socket_js Socket Interface
|
|
|
|
** Exposes network sockets to script.
|
|
|
|
** @{
|
|
|
|
*/
|
|
|
|
|
2021-01-02 13:10:00 -05:00
|
|
|
#include "quickjs.h"
|
|
|
|
|
2024-03-06 12:31:17 -05:00
|
|
|
/**
|
|
|
|
** Register the socket script interface.
|
|
|
|
** @param context The JS context.
|
|
|
|
** @return The Socket constructor.
|
|
|
|
*/
|
2021-10-24 11:46:30 -04:00
|
|
|
JSValue tf_socket_register(JSContext* context);
|
2024-03-06 12:31:17 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
** Get the number of active socket objects.
|
|
|
|
** @return The count.
|
|
|
|
*/
|
2021-01-02 13:10:00 -05:00
|
|
|
int tf_socket_get_count();
|
2024-03-06 12:31:17 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
** Get the number of connected socket objects.
|
|
|
|
** @return the count.
|
|
|
|
*/
|
2021-01-02 13:10:00 -05:00
|
|
|
int tf_socket_get_open_count();
|
2024-02-20 21:41:37 -05:00
|
|
|
|
|
|
|
/** @} */
|