16#ifdef CAN_USE_SYS_SELECT_H
17# include <sys/select.h>
25 char buf[80], cliAddrStr[64];
30 printf(
"subserver[%d]: started, connected to %s.\n", (
int)
getpid(),
31 AddrToAddrStr(cliAddrStr,
sizeof(cliAddrStr), cliAddr, 1,
"<%h:%p>")
35 fprintf(
stderr,
"subserver[%d]: InitSReadlineInfo error: %s\n",
46 }
else if (nread < 0) {
51 for (
i=0;
i<nread;
i++)
71 int sockfd, newsockfd;
77 perror(
"Server setup failed");
84 newsockfd =
SAccept(sockfd, &cliAddr, 5);
91 }
else if ((
pid = fork()) < 0) {
95 }
else if (
pid == 0) {
int SClose(int sfd, int tlen)
GLenum GLuint GLenum GLsizei const GLchar * buf
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
_CRTIMP void __cdecl perror(_In_opt_z_ const char *_ErrMsg)
_Check_return_opt_ _CRTIMP int __cdecl fprintf(_Inout_ FILE *_File, _In_z_ _Printf_format_string_ const char *_Format,...)
_Check_return_ int __cdecl atoi(_In_z_ const char *_Str)
int SWrite(int, const char *const, size_t, int, int)
char * AddrToAddrStr(char *const dst, size_t dsize, struct sockaddr_in *const saddrp, int dns, const char *fmt)
int SNewStreamServer(const int, const int, const int, int)
int SReadline(SReadlineInfo *, char *const, size_t)
int InitSReadlineInfo(SReadlineInfo *, int, char *, size_t, int, int)
const char * strerror(int err)
static void Server(int port)
static void ServeOneClient(int sockfd, struct sockaddr_in *cliAddr)
_In_ ULONG_PTR _In_ ULONG _Out_ ULONG_PTR * pid