C++ SocketsC++ Socket 库

联合创作 · 2023-09-29 10:54

C++ Sockets 是一个跨平台的 Sockets 库,实现包括 TCP、UDP、ICMP、SCTP 协议。已实现的应用协议包括有 SMTP、HTTP(S)、Ajp (1.3)。具有 SOCKS 客户端实现以及匿名 DNS ,支持 HTTP 的 GET/POST/PUT 以及 WebServer 的框架。

示例代码:

#include "StatusSocket.h"


StatusSocket::StatusSocket(ISocketHandler& h)
:TcpSocket(h)
{
}


void StatusSocket::OnAccept()
{
	Send("Local hostname : " + Utility::GetLocalHostname() + "\n");
	Send("Local address : " + Utility::GetLocalAddress() + "\n");
	Send("Number of sockets in list : " + Utility::l2string(Handler().GetCount()) + "\n");
	Send("\n");
}
浏览 5
点赞
评论
收藏
分享

手机扫一扫分享

编辑
举报
评论
图片
表情
推荐
点赞
评论
收藏
分享

手机扫一扫分享

编辑
举报