altEngine
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
net.h
Go to the documentation of this file.
1 #include "include.h"
2 
3 #ifndef NET_H
4 #define NET_H
5 
6 #ifndef WIN32
7 #define SOCKET int
8 #endif
9 
10 #ifdef WIN32
11 int inet_pton(int af, const char *server, void *vaddr);
12 #endif
13 
14 /*
15  UDP non blocking
16 */
17 class Net
18 {
19 public:
20  int connect(char *server, int port);
21  int bind(char *address, int port);
22  int send(char *buffer, int size);
23  int sendto(char *buff, int size, char *to);
24  int recv(char *buff, int size);
25  int recv(char *buffer, int size, int delay);
26  int recvfrom(char *buff, int size, char *from, int length);
27  int strtoaddr(char *str, struct sockaddr_in &addr);
28  void closesock();
29 
30  struct sockaddr_in servaddr;
31  int sockfd;
32 private:
33 
34 
35 };
36 
37 #endif