前言 本次项目可以作为之前内容的一个扩展,学会在Windows端进行网络通信。 该项目需要用到的知识手段较多,在编写该项目的同时也可以对之前C++方面的知识进行一个不错的回顾。 项目需求介绍 本次项目用到 Windows网络套接字编程,多线程,线程池,线程安全,互斥锁,IO流,文件管理,数据结构设计,序列化,反序列化,自定义协议,STL等相关知识和技术。 提示:以下是本篇文章正文内容,下面案例可供参考 一、服务端 #pragma once #include<iostream> #include<string> #include<WinSock2.h> #include<Windows.h> #include<thread> #include<functional> #pragma comment(lib, "ws2_32.lib") #pragma warning(disable:4996) enum Erro { Sock_Error = 1, Bind_Error, Listen_Error }; class Socket { public: Socket(){} void...
Is this you? As a journalist, you can create a free Muck Rack account to customize your profile, list your contact preferences, and upload a portfolio of your best work.
Claim your profile
Get in touch with class
Contact class, search articles and posts on X, monitor coverage, and track replies from one place.
Learn more about Muck Rack