1
0
mirror of https://github.com/CPunch/Laika.git synced 2024-11-22 04:50:06 +00:00

Added laikaS_acceptFrom() to lsocket.h, added LAIKA_MAGIC & LAIKA_MAGICLEN

This commit is contained in:
CPunch 2022-01-24 10:17:54 -06:00
parent c9fdeba4c5
commit 48eebc1951
2 changed files with 4 additions and 0 deletions

View File

@ -1,6 +1,9 @@
#ifndef LAIKA_PACKET_H #ifndef LAIKA_PACKET_H
#define LAIKA_PACKET_H #define LAIKA_PACKET_H
#define LAIKA_MAGIC "LAI\x12"
#define LAIKA_MAGICLEN 4
typedef enum { typedef enum {
LAIKAPKT_HANDSHAKE_REQ, LAIKAPKT_HANDSHAKE_REQ,
LAIKAPKT_HANDSHAKE_RES, LAIKAPKT_HANDSHAKE_RES,

View File

@ -74,6 +74,7 @@ void laikaS_cleanSocket(struct sLaika_socket *sock);
void laikaS_kill(struct sLaika_socket *sock); /* kills a socket */ void laikaS_kill(struct sLaika_socket *sock); /* kills a socket */
void laikaS_connect(struct sLaika_socket *sock, char *ip, char *port); /* connect to ip & port */ void laikaS_connect(struct sLaika_socket *sock, char *ip, char *port); /* connect to ip & port */
void laikaS_bind(struct sLaika_socket *sock, uint16_t port); /* bind sock to port */ void laikaS_bind(struct sLaika_socket *sock, uint16_t port); /* bind sock to port */
void laikaS_acceptFrom(struct sLaika_socket *sock, struct sLaika_socket *from);
bool laikaS_setNonBlock(struct sLaika_socket *sock); bool laikaS_setNonBlock(struct sLaika_socket *sock);
void laikaS_read(struct sLaika_socket *sock, void *buf, size_t sz); /* reads from inBuf */ void laikaS_read(struct sLaika_socket *sock, void *buf, size_t sz); /* reads from inBuf */