Epoll的实现原理: Epoll采用事件触发的机制,通过用户创建Epoll对象并注册事件宏监听具体事件,以达到事件发生时触发任务的执行。 为了更好得理解Epoll的机制,我简单得理解为Socket的交互本身就是两个读、写缓冲区,然后Epoll就是监听这两个缓冲区的数据非空、非满的状态,非空代表有数 ...
分类:
其他好文 时间:
2020-04-16 19:36:17
阅读次数:
59
最近在调研STM32 F10X,准备把公司AVR的MCU项目迁移到STM32上。在调研STM32 i2c这一部分时,在与i2c slave连接断开后,这时再去读/写 i2c slave需要STM32这边的i2c_read/write函数做一些处理。 刚开始在i2c读写timeout后,添加了如下代码 ...
分类:
其他好文 时间:
2020-04-16 19:17:56
阅读次数:
118
import socket import sys import os,time reload(sys) sys.setdefaultencoding('utf8') def send_cmd(command): try: print "开始连接服务端..." client = socket.sock ...
分类:
其他好文 时间:
2020-04-16 18:06:53
阅读次数:
112
声明部分: const int WM_GETTEXT = 0x000D; const int WM_GETTEXTLENGTH = 0x000E; [DllImport("user32.dll", EntryPoint = "SendMessageA")] public static extern ...
键盘操作需要使用send_keys()进行输入 driver.find_element_by_id(元素id).send_keys(输入的内容,Keys.ENTER)如下: send_keys(Keys.ENTER) Enter键 send_keys(Keys.CANCEL,'a') CANCEL+ ...
分类:
Web程序 时间:
2020-04-15 11:17:06
阅读次数:
96
一、鼠标操作 1.1鼠标的悬停操作,move_to_element from selenium import webdriver from selenium.webdriver.common.action_chains import ActionChains action=ActionChains( ...
分类:
Web程序 时间:
2020-04-14 20:37:21
阅读次数:
106
* 重定向的特点:response.sendRedirect(重定向路径); 1. 地址栏发生变化 2. 重定向可以访问其他站点(服务器)的资源 3. 重定向是两次请求。不能使用request对象来共享数据 * 转发的特点:request.getRequestDispatcher(转发路径).for ...
分类:
其他好文 时间:
2020-04-14 15:17:05
阅读次数:
60
If you do not have permission to create the directory object (and assuming that the directory object does not already exist), you'll need to send a re ...
分类:
其他好文 时间:
2020-04-13 12:28:50
阅读次数:
74
https://www.jianshu.com/p/84d0b7eea882eureka注册原理:注册地址:POST 对象com.netflix.appinfo.InstanceInfohttp://localhost:8761/eureka/apps/HELLO-SERVICE {Accept-E ...
分类:
其他好文 时间:
2020-04-13 00:31:29
阅读次数:
89
一、要求 我们在 C#中,有一个keypress事件,可以做到判断输入的字符是否是非法字符。代码如下: public void txt_Str_KeyPress(object sender.KeyPressEventArgs e) { if(!char.IsDigit(e.KeyChar)) { e ...
分类:
编程语言 时间:
2020-04-12 11:04:14
阅读次数:
73