mirror of
https://gitee.com/acl-dev/acl.git
synced 2024-12-15 01:10:52 +08:00
30 lines
377 B
C++
30 lines
377 B
C++
#include "pch.h"
|
|
#include "FiberClient.h"
|
|
|
|
CFiberClient::CFiberClient(SOCKET s)
|
|
: m_sock(s)
|
|
{
|
|
}
|
|
|
|
CFiberClient::~CFiberClient(void)
|
|
{
|
|
closesocket(m_sock);
|
|
}
|
|
|
|
void CFiberClient::run(void)
|
|
{
|
|
char buf[8192];
|
|
while (true) {
|
|
int ret = recv(m_sock, buf, sizeof(buf), 0);
|
|
if (ret <= 0) {
|
|
break;
|
|
}
|
|
|
|
if (send(m_sock, buf, ret, 0) == -1) {
|
|
break;
|
|
}
|
|
}
|
|
|
|
delete this;
|
|
}
|