| 31 #include <string.h> |
31 #include <string.h> |
| 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 "network.h" |
37 #include "network.h" |
| 37 |
38 |
| 38 int net_create_tcp(Server *server, short port) { |
39 int net_create_tcp(Server *server, short port) { |
| 39 memset(server, 0, sizeof(Server)); |
40 memset(server, 0, sizeof(Server)); |
| 40 server->fd = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); |
41 server->fd = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); |