EasySocket
将Windows和Linux的socket库的使用封装成跨平台的类库,轻松使用socket创建连接。
Install / Use
/learn @ysbbswork/EasySocketREADME
EasySocket
将Windows和Linux的socket库的使用封装成跨平台的类库,轻松使用socket。
组成

使用basicsocket
使用基础套接字库库,非常易用!
使用:
#include"EasySocket.h"
调用:
using namespace SocketLib;
ListeningSocket lsock;
DataSocket dsock;
lsock.Listen(5000);//在5000端口开始jiant
dsock = lsock.Accept();//等待流入连接
只有5行代码就完成了Socket API的几十行代码的工作,
封装了socket为人诟病的历史接口等,
代码执行后dsock将包含一个套接字(如果有客户机与我们相连了的话),我们可以向客户机发送数据,并接受客户机的数据:
char buffer[128] = "Hello clent!";
dsock.Send(buffer,strlen(buffer));
dsock.Receive(buffer,128);
文件
main.cpp演示了EasySocket的用法。
Related Skills
node-connect
339.5kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
83.9kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
339.5kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
commit-push-pr
83.9kCommit, push, and open a PR
