Create Server.
24 {
27
30
33
35 int error;
36 for (int i = 0; i < 100; i++)
37 {
38 buffer.
ReadFd(clientSocket.Fd(), &error);
39
40 std::stringstream ss0;
41 ss0 << "Hello Client! " << i;
42
44
45 std::stringstream ss1;
46 ss1 << "Hello Server! " << i;
47
49 buffer.
WriteFd(clientSocket.Fd(), &error);
51 }
52 }
std::string RetrieveAllAsString()
Get readable area data as string.
size_t WriteFd(SOCKET fd, int *saveErrno) const
Write to Socket.
size_t ReadFd(SOCKET fd, int *saveErrno)
Read from Socket.
void RetrieveAll()
Retrieve all buffer data.
void Append(const std::string &msg)
Append Message to this buffer.
Wrapper of readwrite buffer.
This class is Wrapper of current socket address.
SOCKET Accept(InetAddress *peerAddress) const
Accept connection on socket.
void BindAddress(const InetAddress &localAddress) const
Bind address to socket.
void Create()
Create Non Blocking Socket.
void Listen() const
Listen on socket.
This class is Wrapper of socket.