5 |
#include "windows.h" |
#include "windows.h" |
6 |
#include "errno.h" |
#include "errno.h" |
7 |
#include "signal.h" |
#include "signal.h" |
8 |
|
#include "stdlib.h" |
9 |
|
|
10 |
#ifdef DODEBUG |
#ifdef DODEBUG |
11 |
#define dprintf(s,arg) \ |
#define dprintf(s,arg) \ |
112 |
static void |
static void |
113 |
InitSockets() |
InitSockets() |
114 |
{ |
{ |
|
DWORD id; |
|
115 |
WSADATA wsaData; |
WSADATA wsaData; |
116 |
static int initialized; |
static int initialized; |
117 |
if (! initialized) { |
if (! initialized) { |
418 |
* in progress. */ |
* in progress. */ |
419 |
struct sockaddr_in sockaddr; /* Socket address */ |
struct sockaddr_in sockaddr; /* Socket address */ |
420 |
struct sockaddr_in mysockaddr; /* Socket address for client */ |
struct sockaddr_in mysockaddr; /* Socket address for client */ |
421 |
SOCKET sock; |
SOCKET sock = 0; |
422 |
|
|
423 |
/* |
/* |
424 |
* Check that WinSock is initialized; do not call it if not, to |
* Check that WinSock is initialized; do not call it if not, to |
612 |
{ fd_set writefds; |
{ fd_set writefds; |
613 |
int res; |
int res; |
614 |
struct timeval timeout; |
struct timeval timeout; |
|
int err; |
|
615 |
FD_ZERO(&writefds); |
FD_ZERO(&writefds); |
616 |
FD_SET(fd,&writefds); |
FD_SET(fd,&writefds); |
617 |
timeout.tv_sec = (block == 0 ? 0 : 60*60*24*30); |
timeout.tv_sec = (block == 0 ? 0 : 60*60*24*30); |
676 |
Side Effects: The buffer may be filled, and the fill pointer |
Side Effects: The buffer may be filled, and the fill pointer |
677 |
of the buffer may be changed. |
of the buffer may be changed. |
678 |
*/ |
*/ |
679 |
getCharGclSocket(strm,block) |
int getCharGclSocket(strm,block) |
680 |
object strm; |
object strm; |
681 |
object block; |
object block; |
682 |
{ |
{ |
765 |
} |
} |
766 |
*/ |
*/ |
767 |
|
|
768 |
|
#if 0 |
769 |
BOOL WINAPI inthandler(DWORD i) |
BOOL WINAPI inthandler(DWORD i) |
770 |
{ |
{ |
771 |
fprintf(stderr,"in handler %d",i); |
fprintf(stderr,"in handler %d",i); |
772 |
fflush(stderr); |
fflush(stderr); |
773 |
terminal_interrupt(1); |
terminal_interrupt(1); |
774 |
|
return TRUE; |
775 |
} |
} |
776 |
|
#endif |
777 |
|
|
778 |
|
|
779 |
void |
void |
780 |
alarm(int n) { |
alarm(int n) { |
|
/* printf("dummy alarm"); */ |
|
781 |
return; |
return; |
782 |
} |
} |
783 |
|
|