ReactOS  0.4.13-dev-259-g5ca9c9c
SNew.c File Reference
#include "syshdrs.h"
Include dependency graph for SNew.c:

Go to the source code of this file.

Functions

int SNewStreamClient (void)
 
int SNewDatagramClient (void)
 
int SNewStreamServer (const int port, const int nTries, const int reuseFlag, int listenQueueSize)
 
int SNewDatagramServer (const int port, const int nTries, const int reuseFlag)
 

Function Documentation

◆ SNewDatagramClient()

int SNewDatagramClient ( void  )

Definition at line 19 of file SNew.c.

20 {
21  int sfd;
22 
23  sfd = socket(AF_INET, SOCK_DGRAM, 0);
24  if (sfd < 0)
25  return kSNewFailed;
26 
27  return (sfd);
28 } /* SNewDatagramClient */
SOCKET WSAAPI socket(IN INT af, IN INT type, IN INT protocol)
Definition: socklife.c:143
#define kSNewFailed
Definition: sio.h:64
#define AF_INET
Definition: tcpip.h:117
#define SOCK_DGRAM
Definition: winsock.h:336

◆ SNewDatagramServer()

int SNewDatagramServer ( const int  port,
const int  nTries,
const int  reuseFlag 
)

Definition at line 64 of file SNew.c.

65 {
66  int oerrno;
67  int sfd;
68 
69  sfd = socket(AF_INET, SOCK_DGRAM, 0);
70  if (sfd < 0)
71  return kSNewFailed;
72 
73  if (SBind(sfd, port, nTries, reuseFlag) < 0) {
74  oerrno = errno;
75  (void) closesocket(sfd);
76  errno = oerrno;
77  return kSBindFailed;
78  }
79 
80  return (sfd);
81 } /* SNewDatagramServer */
struct png_info_def **typedef void(__cdecl typeof(png_destroy_read_struct))(struct png_struct_def **
Definition: typeof.h:49
SOCKET WSAAPI socket(IN INT af, IN INT type, IN INT protocol)
Definition: socklife.c:143
int errno
#define closesocket
Definition: main.c:39
#define kSNewFailed
Definition: sio.h:64
#define kSBindFailed
Definition: sio.h:65
#define AF_INET
Definition: tcpip.h:117
int SBind(int sockfd, const int port, const int nTries, const int reuseFlag)
Definition: SBind.c:4
#define SOCK_DGRAM
Definition: winsock.h:336
USHORT port
Definition: uri.c:227

◆ SNewStreamClient()

int SNewStreamClient ( void  )

Definition at line 4 of file SNew.c.

5 {
6  int sfd;
7 
8  sfd = socket(AF_INET, SOCK_STREAM, 0);
9  if (sfd < 0)
10  return kSNewFailed;
11 
12  return (sfd);
13 } /* SNewStreamClient */
SOCKET WSAAPI socket(IN INT af, IN INT type, IN INT protocol)
Definition: socklife.c:143
#define kSNewFailed
Definition: sio.h:64
#define AF_INET
Definition: tcpip.h:117
#define SOCK_STREAM
Definition: tcpip.h:118

◆ SNewStreamServer()

int SNewStreamServer ( const int  port,
const int  nTries,
const int  reuseFlag,
int  listenQueueSize 
)

Definition at line 34 of file SNew.c.

35 {
36  int oerrno;
37  int sfd;
38 
39  sfd = socket(AF_INET, SOCK_STREAM, 0);
40  if (sfd < 0)
41  return kSNewFailed;
42 
43  if (SBind(sfd, port, nTries, reuseFlag) < 0) {
44  oerrno = errno;
45  (void) closesocket(sfd);
46  errno = oerrno;
47  return kSBindFailed;
48  }
49 
50  if (SListen(sfd, listenQueueSize) < 0) {
51  oerrno = errno;
52  (void) closesocket(sfd);
53  errno = oerrno;
54  return kSListenFailed;
55  }
56 
57  return (sfd);
58 } /* SNewStreamServer */
int SListen(int sfd, int backlog)
Definition: SBind.c:60
#define kSListenFailed
Definition: sio.h:66
struct png_info_def **typedef void(__cdecl typeof(png_destroy_read_struct))(struct png_struct_def **
Definition: typeof.h:49
SOCKET WSAAPI socket(IN INT af, IN INT type, IN INT protocol)
Definition: socklife.c:143
int errno
#define closesocket
Definition: main.c:39
#define kSNewFailed
Definition: sio.h:64
#define kSBindFailed
Definition: sio.h:65
#define AF_INET
Definition: tcpip.h:117
int SBind(int sockfd, const int port, const int nTries, const int reuseFlag)
Definition: SBind.c:4
#define SOCK_STREAM
Definition: tcpip.h:118
USHORT port
Definition: uri.c:227

Referenced by Server().