socket编程原理1、问题的引入1) 普通的I/O操作过程:UNIX系统的I/O命令集,是从Maltics和早期系统中的命令演变出来的,其模式为打开一读/写一关闭(open-write-read-close)。在一个用户进程进行I/O操作时,它首先调用“打开”获得对指定文件或设备的使用权,并返回称...
分类:
其他好文 时间:
2014-06-28 18:42:31
阅读次数:
301
phpstorm调试php错误提示:Host 'localhost' has multiple addresses. You must choose one explicitly!Couldn't create FastCGI listen socket on port localhost:3568...
分类:
其他好文 时间:
2014-06-28 14:22:59
阅读次数:
283
http://blog.csdn.net/tianmohust/article/details/8691644在Linux中使用非阻塞的socket的情形下。(一)发送时 当客户通过Socket提供的send函数发送大的数据包时,就可能返回一个EAGAIN的错误。该错误产生的原因是由于send 函....
分类:
系统相关 时间:
2014-06-28 14:10:43
阅读次数:
306
--mysqladmin shutdownIf you executemysqladmin shutdownwhen connecting to a local server using a Unix socket file,mysqladminwaits until the server's pr...
分类:
数据库 时间:
2014-06-28 11:43:06
阅读次数:
270
1,getsockopt连续调用问题通常情况下,在一个socket fd上出现错误时,我们会通过int status;socklen_t slen;getsockopt(fd, SOL_SOCKET, SO_ERROR, (void *) &status, &slen); 这种方法来获取具体的错误....
分类:
其他好文 时间:
2014-06-24 10:04:02
阅读次数:
206
你要是看过basic_stream_socket的文档,里面提到async_write_some不能保证将所有要发送的数据都发出去。并且提到如果想这样做,需要使用boost asio的async_writehttp://www.boost.org/doc/libs/1_53_0/doc/html/b...
分类:
其他好文 时间:
2014-06-24 09:22:01
阅读次数:
282
7.2面向套接字编程 我们已经通过了解Socket的接口,知其所以然,下面我们就将通过具体的案例,来熟悉Socket的具体工作方式7.2.1使用套接字实现基于TCP协议的服务器和客户机程序依据TCP协议,在C/S架构的通讯过程中,客户端和服务器的Socket动作如下:客户端:1.用服务器的IP地址....
分类:
编程语言 时间:
2014-06-23 00:52:25
阅读次数:
258
执行网络I/O,一个进程必须做的第一件事就是调用socket函数,指定期望的通信协议类型。
#include
int socket(int family, int type, int protocol);
/*返回值:若成功则为非负描述符,若出错则为-1*/
socket函数成功时返回一个小的非负整数值,它与文件描述符类似,把它称为套接字描述符,简称sockfd。family参数指明协议...
分类:
其他好文 时间:
2014-06-22 15:40:10
阅读次数:
301
import socket #获取本机IP地址 self.local_ip = socket.gethostbyname(socket.gethostname()) print (self.local_ip) python 判断本机是否联网 1 ...
分类:
编程语言 时间:
2014-06-21 14:19:26
阅读次数:
273
需要以下jar包:---log4jcommons-loggin-1.1.1.jarlog4j-1.2.16.jar---mysqlmysql-connector-java-5.1.15-bin.jar---log4j.properties配置内容log4j.rootLogger=INFO,DATAB...
分类:
数据库 时间:
2014-06-20 16:11:50
阅读次数:
206