|
Revision 1, 0.8 kB
(checked in by heitor.barbieri, 4 years ago)
|
|
Criação do svn para Cisis.
|
| Line | |
|---|
| 1 | |
|---|
| 2 | #include <time.h> |
|---|
| 3 | |
|---|
| 4 | int mainserver (int cmd, uint16_t port, char *buffer, int buffersize, int maxconnqueued); |
|---|
| 5 | |
|---|
| 6 | |
|---|
| 7 | /* |
|---|
| 8 | fake mainserver |
|---|
| 9 | */ |
|---|
| 10 | int |
|---|
| 11 | mainserver (int cmd, uint16_t port, char *buffer, int buffersize, int maxconnqueued) |
|---|
| 12 | { |
|---|
| 13 | int sock; |
|---|
| 14 | char timestamp[80]; /* 123456789012345678901234 7 8 901 */ |
|---|
| 15 | LONGX secs_now; |
|---|
| 16 | struct tm *tp; |
|---|
| 17 | |
|---|
| 18 | /* Create the socket and set it up to accept connections. */ |
|---|
| 19 | sock = 3; |
|---|
| 20 | |
|---|
| 21 | time(&secs_now); tp=localtime(&secs_now); |
|---|
| 22 | sprintf(timestamp,"%04d%02d%02d %02d%02d%02d %1d %3d", 1900+tp->tm_year,tp->tm_mon+1,tp->tm_mday, tp->tm_hour,tp->tm_min,tp->tm_sec, tp->tm_wday,tp->tm_yday); |
|---|
| 23 | |
|---|
| 24 | if (cmd == 3) fprintf (stderr, "Server [%d] [%d] [%s]: got socket \n", port, sock, timestamp); |
|---|
| 25 | |
|---|
| 26 | } /* end of mainserver */ |
|---|
| 27 | |
|---|
| 28 | |
|---|