mirror of
https://github.com/CPunch/Laika.git
synced 2024-11-21 20:40:05 +00:00
Added laikaS_acceptFrom() to lsocket.h, added LAIKA_MAGIC & LAIKA_MAGICLEN
This commit is contained in:
parent
c9fdeba4c5
commit
48eebc1951
@ -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,
|
||||||
|
@ -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 */
|
||||||
|
Loading…
Reference in New Issue
Block a user