| 15 |
* * |
* * |
| 16 |
***************************************************************************/ |
***************************************************************************/ |
| 17 |
|
|
| 18 |
|
#include "net_server.h" |
| 19 |
#include "common.h" |
#include "common.h" |
| 20 |
|
#include "log.h" |
| 21 |
#include "io.h" |
#include "io.h" |
| 22 |
|
#include "fork.h" |
| 23 |
#include "tcplib.h" |
#include "tcplib.h" |
| 24 |
#include <sys/socket.h> |
#include <sys/socket.h> |
| 25 |
#include <netinet/in.h> |
#include <netinet/in.h> |
| 27 |
|
|
| 28 |
int net_server(const char *hostaddr, unsigned int port) |
int net_server(const char *hostaddr, unsigned int port) |
| 29 |
{ |
{ |
| 30 |
int namelen, seq, netint, result, flags; |
unsigned int namelen; |
| 31 |
|
int result; |
| 32 |
|
int flags; |
| 33 |
struct sockaddr_in sin; |
struct sockaddr_in sin; |
|
char temp[256]; |
|
| 34 |
fd_set testfds; |
fd_set testfds; |
| 35 |
struct timeval timeout; |
struct timeval timeout; |
| 36 |
|
|