1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
|
#ifndef PSOCKET_H_INCLUDED
#define PSOCKET_H_INCLUDED
#include <netdb.h>
void
ReadInt(int const socketFd,
int * const valueP);
void
ReadBytes(int const fd,
unsigned char * const buf,
unsigned int const nbyte);
void
WriteInt(int const socketFd,
int const value);
void
WriteBytes(int const fd,
unsigned char * const buf,
unsigned int const nbyte);
void
ConnectToSocket(const char * const machineName,
int const portNum,
struct hostent ** const hostEnt,
int * const socketFdP,
const char ** const errorP);
void
CreateListeningSocket(int * const socketP,
int * const portNumP,
const char ** const errorP);
void
AcceptConnection(int const listenSocketFd,
int * const connectSocketFdP,
const char ** const errorP);
#endif
|