2021-04-12 13:39:07 +02:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "lokinet_context.h"
|
|
|
|
#include "lokinet_os.h"
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C"
|
|
|
|
{
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/// poll many sockets for activity
|
|
|
|
/// each pollfd.fd should be set to the socket id
|
|
|
|
/// returns 0 on sucess
|
2021-06-08 14:32:01 +02:00
|
|
|
int EXPORT
|
2021-04-12 13:39:07 +02:00
|
|
|
lokinet_poll(struct pollfd* poll, nfds_t numsockets, struct lokinet_context* ctx);
|
|
|
|
|
|
|
|
/// close a udp socket or a stream socket by its id
|
2021-06-08 14:32:01 +02:00
|
|
|
void EXPORT
|
2021-04-12 13:39:07 +02:00
|
|
|
lokinet_close_socket(int id, struct lokinet_context* ctx);
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|