Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 2 years ago.
The community reviewed whether to reopen this question last year and left it closed:
Original close reason(s) were not resolved
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
接受
或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
发布评论
评论(6)
要了解套接字并正确使用它们,您需要《套接字圣经》:
W. Richard Stevens,Unix 网络编程,第 1 卷:套接字网络 API(第 3 版)
你绝对必须拥有这本书在你坐下来写一行套接字代码之前。没有它就不要离开家。真的。起价约为 35 美元,在 Amazon 上使用。
编辑:OP询问其他卷。这里还有另外两个:
W.理查德·史蒂文斯,
UNIX 网络编程,第 2 卷:
进程间通信(第二
版)
W.理查德·史蒂文斯,
TCP/IP 图解,卷。 1:
协议
它们具有史蒂文斯一贯的和预期的卓越品质。我不知道他整合所有这些书的计划是什么,
To understand sockets and use them right, you need The Sockets Bible:
W. Richard Stevens, Unix Network Programming, Volume 1: The Sockets Networking API (3rd Edition)
You absolutely must have this book before you sit down to write a line of sockets code. Don't leave home without it. Really. Starting around $35 used at Amazon.
EDIT: The OP asked about other volumes. Here are two others:
W. Richard Stevens,
UNIX Network Programming, Volume 2:
Interprocess Communications (2nd
Edition)
W. Richard Stevens,
TCP/IP Illustrated, Vol. 1: The
Protocols
They are of Stevens's usual and expected superb quality. I don't know what his plans were for integrating all these books,
提升。asio(在我看来)是用现代 C++ 编写与平台无关的网络代码的事实上的标准。
boost.asio is (in my opinion) the de facto standard for writing platform independant networking code in modern C++.
我的建议:
我首先使用编写速度快、功能强大的高级语言(例如 python)编写机器人。习惯使用网络工具、IRC 协议等。
了解底层的套接字和网络。对于 Unix,我建议看一下《Unix 网络编程》。
用 C++ 编写您的机器人!犯错误,改正错误,然后坚持下去。
My recommendations:
I'd first write the bot in fast-to-write, powerful high-level language, such as python. Get used to working with net tools, the IRC protocol and stuff.
Learn about sockets and networking at low-level. For Unix, I'd say take a look at Unix Network Programming.
Write your bot in C++! Make mistakes, fix them, and keep at it.
学习 C/C++ 套接字编程的最佳指南必须是 Beej 网络指南到目前为止,编程。它通过示例和详细说明完成了您需要了解的所有步骤。据我所知,该站点唯一缺乏的信息是 IPv6 多播。
The best guide to learn socket programming in C/C++ must be Beej's Guide to Network Programming by far. It goes through all of the steps you need to know, both with examples and detailed description. As far as I know, the only information this site lacks is of IPv6 Multicasting.
从一个简单的客户端-服务器示例开始。使用 Qt 框架非常容易。例如:
server.cpp:
client.cpp:
您所需要做的就是在一个终端窗口中运行第一个程序,在另一个终端窗口中运行第二个程序。
您可以在此处找到更多 Qt 网络示例
Start with a simple client-server example. It's very easy with Qt framework. For example:
server.cpp:
client.cpp:
All you need to do is to run the first program in one terminal window, and the second in the other.
You will find more Qt network examples here
我知道这本书很老了,有一本叫做
“Beej's Guide to Network Programming using Internet Socket”
的书Beej 提供的所有内容都是 100% 免费的,可以访问这里的网站来学习网络编程的基础知识。
https://beej.us/guide/bgnet/
这里提供的书籍我仍然建议您获取因为它们提供了有关套接字和 TCP/IP 协议的非常可靠的信息。
Unix 网络编程:套接字网络 Api Unix 网络编程:套接字网络 Api - 作者:W. Richard Stevens
TCP/IP 插图,卷。 1:协议(Addison-Wesley 专业计算系列)TCP/IP 图解,卷。 1:W. Richard Stevens 的协议(Addison-Wesley 专业计算系列)
UNIX 网络编程,第 2 卷:进程间通信,第二版UNIX 网络编程,卷 2:进程间通信,第二版,作者:W. Richard Stevens
TCP/IP 插图,第 1 卷:协议(Addison-Wesley 专业计算系列)第二版版
作者:Kevin Fall(作者)、W. Stevens(作者)
TCP/IP 指南:全面、图解的 Internet 协议参考,第一版
作者:查尔斯·M·科齐罗克
我不是网络程序员或软件开发人员,我唯一的兴趣是仅用于游戏开发的虚幻引擎的网络和复制。请不要给我发私信或询问有关网络的问题。
I know this is old there's book called
"Beej's Guide to Network Programming using Internet Socket"
Everything what Beej provides is 100% free to access here's the website to go and learn the basics of Network Programming.
https://beej.us/guide/bgnet/
The books provided on here I still recommend getting because they offer a pretty solid information on sockets and TCP/IP protocols.
Unix Network Programming: The Sockets Networking Api Unix Network Programming: The Sockets Networking Api - by W. Richard Stevens
TCP/IP Illustrated, Vol. 1: The Protocols (Addison-Wesley Professional Computing Series)TCP/IP Illustrated, Vol. 1: The Protocols (Addison-Wesley Professional Computing Series) by W. Richard Stevens
UNIX Network Programming, Volume 2: Interprocess Communications, Second EditionUNIX Network Programming, Volume 2: Interprocess Communications, Second Edition by W. Richard Stevens
TCP/IP Illustrated, Volume 1: The Protocols (Addison-Wesley Professional Computing Series) 2nd Edition
by Kevin Fall (Author), W. Stevens (Author)
The TCP/IP Guide: A Comprehensive, Illustrated Internet Protocols Reference 1st Edition
by Charles M. Kozierok
I am NOT a network programmer or software developer my only interest is Networking and Replication for Unreal Engine for game-development only. Please don't send me PMs or ask questions regarding about Networking.