-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathxyudp.h
39 lines (34 loc) · 1.28 KB
/
xyudp.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#ifndef XYUDP_H
#define XYUDP_H
//---------------------------------------------------------------------------
#include <stdio.h>
#include <errno.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/select.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <fcntl.h>
//---------------------------------------------------------------------------
//---------------------------------------------------------------------------
#define XYSOCKET_CLOSE 0
#define XYSOCKET_RECV 2
#define XYSOCKET_TIMEOUT 4
#define XYSOCKET_ERROR_FAILED 5
//---------------------------------------------------------------------------
struct xyudp;
typedef int (*xyudp_procedure)(struct xyudp *, const void *, const void *, int, unsigned char, const struct sockaddr *, int *, const char *, int *);
//---------------------------------------------------------------------------
struct xyudp
{
const void *parameter;
const void *context;
xyudp_procedure procedure;
int fd;
int milliseconds;
};
//---------------------------------------------------------------------------
unsigned int xyudp_proc(struct xyudp* pudp);
//---------------------------------------------------------------------------
#endif