C++ Sockets Library

 

来自:http://www.oschina.net/p/cpp+sockets

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

示例代码:

#include 
#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");
}

 相关链接 :

 

 

posted @ 2009-07-17 10:31  vily_雷  阅读(1254)  评论(0)    收藏  举报