1.简要 从前用的网络编程函数现在又做了一定的改动,报了这么3个错误. error C4996: 'inet_ntoa': Use inet_ntop() or InetNtop() instead or define _WINSOCK_DEPRECATED_NO_WARNINGS to disable deprecated API warnings error C4996: 'gethostbyaddr': Use getnameinfo() or GetNameInfoW() instead…
刚看了反应堆模式的原理,特意复习了socket编程,本文主要介绍python的基本socket使用和select使用,主要用于了解socket通信过程 一.socket模块 socket - Low-level networking interface This module provides access to the BSD socket interface. It is available on all modern Unix systems, Windows, MacOS, and pr…
第5章 Linux网络编程基础 5.1 socket地址与API 一.理解字节序 主机字节序一般为小端字节序.网络字节序一般为大端字节序.当格式化的数据在两台使用了不同字节序的主机之间直接传递时,接收端要根据自身采用的字节序决定是否对其接收到的数据进行转换. 在Linux上提供了4个函数来完成主机字节序和网络字节序之间的转换. #include<netinet/in.h> unsigned long int htonl(unsigned long int hostlong); unsigned…