8 sfd
= socket(AF_INET
, SOCK_STREAM
, 0);
13 } /* SNewStreamClient */
19 SNewDatagramClient(void)
23 sfd
= socket(AF_INET
, SOCK_DGRAM
, 0);
28 } /* SNewDatagramClient */
34 SNewStreamServer(const int port
, const int nTries
, const int reuseFlag
, int listenQueueSize
)
39 sfd
= socket(AF_INET
, SOCK_STREAM
, 0);
43 if (SBind(sfd
, port
, nTries
, reuseFlag
) < 0) {
45 (void) closesocket(sfd
);
50 if (SListen(sfd
, listenQueueSize
) < 0) {
52 (void) closesocket(sfd
);
54 return kSListenFailed
;
58 } /* SNewStreamServer */
64 SNewDatagramServer(const int port
, const int nTries
, const int reuseFlag
)
69 sfd
= socket(AF_INET
, SOCK_DGRAM
, 0);
73 if (SBind(sfd
, port
, nTries
, reuseFlag
) < 0) {
75 (void) closesocket(sfd
);
81 } /* SNewDatagramServer */