事务并发所带来的问题 脏读:一个事务读取到另一个事务尚未提交的数据。 不可重复读:同一事务,两次读取同一数据,得到不同的结果。 幻读:同一事务,用相同的条件读取两次,得到的结果集数据条数不同(数据条数...
分类:
其他好文 时间:
2014-07-22 09:10:36
阅读次数:
191
不知大家是否见过这样一种让人“眼花缭乱”的位域操作, int read = 0 << 1; int write = 0 << 2; int connect = 0<<3; 最典型的就是jdk nio里的SelectionKey了,当你判断一个selectionkey所感兴趣的操作时,你不...
分类:
其他好文 时间:
2014-07-22 08:25:36
阅读次数:
201
The DecoderWrite a complete program that will correctly decode a set of characters into a valid message. Your program should read a given file of a si...
分类:
其他好文 时间:
2014-07-22 00:38:34
阅读次数:
235
linux下文件的读写操作(openreadwrite)转http://www.2cto.com/os/201403/285837.htmlopen(打开文件)相关函数 read,write,fcntl,close,link,stat,umask,unlink,fopen表头文件 #include#...
分类:
系统相关 时间:
2014-07-22 00:35:33
阅读次数:
373
下图是asterisk的呼叫流程图:
我们以sip的呼叫过程为例来描述,其他channel的呼叫过程基本类似。
Astersik下注册的sip用户主动发起一个呼叫的函数调用过程(incoming)如下:
do_monitor->sipsock_read->handle_request->handle_request_invite->sip_new/ast_pbx_start->pbx_th...
分类:
其他好文 时间:
2014-07-22 00:27:37
阅读次数:
294
从socket中读取数据可以使用如下的代码: while( (n = read(socketfd, buf, BUFSIZE) ) >0) if( write(STDOUT_FILENO, buf, n) = n) { printf(“write error”); exit(1); }当代码中的so...
分类:
其他好文 时间:
2014-07-22 00:26:33
阅读次数:
267
1、打开外部程序1.1os.system—>发送命令,让系统执行,没有返回值os.popen—>可执行系统命令,可以获取标准输出lll=os.popen(‘ls’)lll.read()os.popen2—>元组方式返回标准输入和标准输出stdin,stdou=os.popen2(‘sort’)s=‘’’ecdbe’’stdin.write(s)stdin.clo..
分类:
编程语言 时间:
2014-07-21 19:27:02
阅读次数:
322
核心提示:先列出 HessianPHP 的错误提示: CURL transport error: transfer closed with outstanding read data remaining 基础知识背景: 1)“Expect: 100-continue”的来龙去脉: HTTP/1.1 协议里设计100 (Co...
分类:
其他好文 时间:
2014-07-21 10:17:53
阅读次数:
226
由于python目前不能直接处理中文路径,必须要转化一下,如下例子是下载图片(名字为中文的): def getInfo(self,imageurl): response = urllib.request.urlopen(imageurl).read().decode('utf-8')# with o...
分类:
编程语言 时间:
2014-07-21 08:09:58
阅读次数:
210
从写一个TCP套接字的write调用成功返回仅仅表示我们可以重新使用原来的应用进程缓冲区,并不代表对端TCP或应用进程已接收到数据。
对端TCP必须确认收到的数据,伴随来自对端的ACK的不断到达,本端TCP至此才能从套接字发送缓冲区中丢弃已确认的数据,TCP必须为已发送的数据保留一个副本,直到它被对端确认为止。
UDP不保存应用进程数据的副本因此无需一个真正的发送缓冲区,wri...
分类:
其他好文 时间:
2014-07-20 22:12:23
阅读次数:
333