| 19 |
#include "io.h" |
#include "io.h" |
| 20 |
#include <sys/socket.h> |
#include <sys/socket.h> |
| 21 |
#include <netinet/in.h> |
#include <netinet/in.h> |
| 22 |
|
#include <arpa/inet.h> |
| 23 |
|
|
| 24 |
int |
int |
| 25 |
net_server (const char *hostaddr, unsigned int port) |
net_server (const char *hostaddr, unsigned int port) |
| 54 |
exit (3); |
exit (3); |
| 55 |
} |
} |
| 56 |
|
|
| 57 |
strcpy(hostaddr_server,(const char *)inet_ntoa(sin.sin_addr)); |
strcpy(hostaddr_server, inet_ntoa(sin.sin_addr)); |
| 58 |
port_server = ntohs(sin.sin_port); |
port_server = ntohs(sin.sin_port); |
| 59 |
|
|
| 60 |
// log_std ("Listening at %s:%d\n", hostaddr_server, port_server); |
log_std ("Listening at %s:%d\n", hostaddr_server, port_server); |
|
log_std ("Listening at %s:%d\n", "0.0.0.0", 2323); |
|
| 61 |
|
|
| 62 |
namelen = sizeof (sin); |
namelen = sizeof (sin); |
| 63 |
while(1) |
while(1) |