| 32 #include <stdio.h> |
32 #include <stdio.h> |
| 33 #include <unistd.h> |
33 #include <unistd.h> |
| 34 #include <sys/un.h> |
34 #include <sys/un.h> |
| 35 #include <sys/stat.h> |
35 #include <sys/stat.h> |
| 36 #include <netdb.h> |
36 #include <netdb.h> |
| |
37 #include <netinet/in.h> |
| 37 #include "network.h" |
38 #include "network.h" |
| 38 |
39 |
| 39 int net_create_tcp(Server *server, short port) { |
40 int net_create_tcp(Server *server, short port) { |
| 40 memset(server, 0, sizeof(Server)); |
41 memset(server, 0, sizeof(Server)); |
| 41 server->fd = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); |
42 server->fd = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); |