客户端服务端通信demo
![preview](https://csdnimg.cn/release/downloadcmsfe/public/img/white-bg.ca8570fa.png)
![preview-icon](https://csdnimg.cn/release/downloadcmsfe/public/img/scale.ab9e0183.png)
3.1 控件基本方法(method) 3.1.1 S_InitListen 函数原型 :SHORT S_InitListen(SHORT m_Port) 功能 : 建立服务器端侦听端口 参数 : m_Port 服务器侦听端口号 返回值: :0:成功 1:失败 3.1.2 S_OnSendMsg 函数原型 :SHORT S_OnSendMsg(LPCTSTR m_ip, LPCTSTR m_Msg); 功能 : 单条消息发送 参数 : m_ip 接收端Ip地址 m_Msg 消息信息 返回值: :0 发送成功 1 发送失败 3.1.3 S_OnPushMsg 函数原型 :SHORT S_OnPushMsg(LPCTSTR m_Msg); 功能 : 群发消息 参数 : m_Msg 消息信息 返回值: :0 成功 1:失败 3.1.4 C_OnConnect 函数原型 :SHORT C_OnConnect(LPCTSTR m_ip, SHORT m_port); 功能 : 客户端连接服务器 参数 : m_ip 服务器端ip地址 参数 : m_port 端口号 返回值: :0 成功 1失败 3.1.5 C_OnSendMsg 函数原型 :SHORT C_OnSendMsg(LPCTSTR m_Msg); 功能 : 发送消息 参数 : m_Msg 消息信息 返回值: :0 成功 1失败 3.2 控件事件(event) 3.2.1 FireReceiveSocketMsg 原型 :void FireReceivedSocketMsg(SHORT m_Event, LPCTSTR m_Msg) 功能 :客户端消息 参数 : m_Event 事件类型 1:客户端消息事件 2:客户端通讯错误事件 参数 : m_Msg 事件信息 3.2.2 FireServerReceiveSocketMsg 原型 :void FireServerReceivedSocketMsgWinsocketocxctrl(SHORT m_Event, LPCTSTR m_Msg , LPCTSTR m_Address) 功能 :服务器端消息 参数 : m_Event 事件类型 1:服务器端消息事件 2: 服务器通讯错误事件 3:客户端连接到服务器通知事件(返回客户端ip) 4:客户端断开服务器通知事件(返回客户端ip) 参数 : m_Msg 事件信息 参数 : m_ Address 客户端ip地址 .4 备注 通讯日志存储在C:\ _SOCKET.LOG
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![txt](https://img-home.csdnimg.cn/images/20210720083642.png)
![package](https://csdnimg.cn/release/downloadcmsfe/public/img/package.f3fc750b.png)
![folder](https://csdnimg.cn/release/downloadcmsfe/public/img/folder.005fa2e5.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/BMP.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/TXT.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
- 1
![avatar-default](https://csdnimg.cn/release/downloadcmsfe/public/img/lazyLogo2.1882d7f4.png)
![avatar](https://profile-avatar.csdnimg.cn/aaec9a983f9848b98609db0e6de4d167_miaobinbin.jpg!1)
- 粉丝: 3
- 资源: 17
我的内容管理 展开
我的资源 快来上传第一个资源
我的收益
登录查看自己的收益我的积分 登录查看自己的积分
我的C币 登录后查看C币余额
我的收藏
我的下载
下载帮助
![voice](https://csdnimg.cn/release/downloadcmsfe/public/img/voice.245cc511.png)
![center-task](https://csdnimg.cn/release/downloadcmsfe/public/img/center-task.c2eda91a.png)
![dialog-icon](https://csdnimg.cn/release/downloadcmsfe/public/img/green-success.6a4acb44.png)