WinpCap 使用线程发数,明明发了,返回值0是OK的啊,怎么抓包看不到,难道不支持多线程。。。
if (!m_adapterHandle)
{
return false;
}
int rst = pcap_sendpacket((pcap_t*)m_adapterHandle,data ,dataLen);
if(rst != 0)
{
return true;
}
return false;
看我标黑的就知道了吧,datalen如果为0,发不出去。
而且data如果内容全为’\0’,那么也会被屏蔽掉。
这一点官方文档并没有确切的描述,请注意(当然,正常情况下你的报文应该有protocol headers,那么必然是可以发出去的。)
附API说明:
int pcap_sendpacket
(
pcap_t *
p,
u_char *
buf,
int
size
)
Send a raw packet.
This function allows to send a raw packet to the network. p is the interface that will be used to send the packet, buf contains the data of the packet to send (including the various protocol headers), size is the dimension of the buffer pointed by buf, i.e. the size of the packet to send. The MAC CRC doesn't need to be included, because it is transparently calculated and added by the network interface driver. The return value is 0 if the packet is succesfully sent, -1 otherwise.
WinpCap 使用线程发数,明明发了,返回值0是OK的啊,怎么抓包看不到,难道不支持多线程。。。的更多相关文章
- Thread(线程)和ThreadPool(线程池) Thread回调与返回值
Thread(线程) Thread开启线程:接收一个参数 TestClass tc = new TestClass(); //没有返回值,有一个object类型的参数的委托:两种写法. Paramet ...
- Python从线程获取函数返回值
Python中利用强大的threading模块可以很容易的实现多线程开发,提高运行速度.这一般是对某个进行大量计算操作的的函数进行多线程处理,然后合并各线程的结果.获取函数返回值的方法可以如下: 1) ...
- Android平台调用Web Service:线程返回值
接上文 前文中的遗留问题 对于Java多线程的理解,我曾经只局限于实现Runnable接口或者继承Thread类.然后重写run()方法.最后start()调用就算完事,可是一旦涉及死锁以及对共享资源 ...
- Objective-C学习笔记(二十一)——函数的返回值与參数类型
我们在之前的博客中涉及到的函数都没有參数,同一时候返回值也为void,即不须要返回值. 可是在以后的开发中.函数返回值和參数是必须涉及到的. 所以如今我们来讨论这个问题.我们还是以People类为例. ...
- C#开发微信门户及应用(15)-微信菜单增加扫一扫、发图片、发地理位置功能
前面介绍了很多篇关于使用C#开发微信门户及应用的文章,基本上把当时微信能做的接口都封装差不多了,微信框架也积累了不少模块和用户,最近发现微信公众平台增加了不少内容,特别是在自定义菜单里面增加了扫一扫. ...
- 微信公众平台自定义菜单新增扫一扫、发图片、发位置 LBS运作更便捷
今天微信公众平台发布更新,自定义菜单新增扫一扫.发图片.发送位置等功能,这对于有意挖掘微信LBS服务的运营者来说更便捷了,订阅号不用返回微信界面就能扫图.发送图片.调用地理位置,用户体验更友好,自然也 ...
- iOS中打电话、打开网址、发邮件、发短信等
常用小功能 小功能简介 iOS中的很多小功能都是非常简单的,几行代码就搞定了,比如打电话.打开网址.发邮件.发短信等 打电话-方法1 最简单最直接的方式:直接跳到拨号界面 NSURL *url = [ ...
- AJ学IOS(45)之常用的小功能比如打电话、打开网址、发邮件、发短信打开其他应用。
AJ分享,必须精品 简介 iOS中的很多小功能都是非常简单的,几行代码就搞定了,比如打电话.打开网址.发邮件.发短信.打开其他应用等. 打电话 方法1 最简单最直接的方式:直接跳到拨号界面 NSURL ...
- arti车是大幅度发地方大幅度发
转: arti车是大幅度发地方大幅度发 arti车是大幅度发地方大幅度发 转: arti车是大幅度发地方大幅度发
随机推荐
- chapter3:Collaborative Filtering ---------A Programmer's Guide to Data Mining
Implicit rating and item based filtering Explicit rating: 用户明确的对item评分 Implicit rating:反之 明确评分所存在的问题 ...
- html背景为灰色 不能操作,中间div可以操作
<container style="position: absolute; top: 0px; left: 0px; width: 0px; height: 0px; z-index: ...
- webview改变网页宽度
- (void)webViewDidFinishLoad:(UIWebView *)webView { //修改服务器页面的meta的值 NSString *meta = [NSString stri ...
- UILable自适应frame
UILabel *textlab = [[UILabel alloc]initWithFrame:CGRectMake(20, 10,ScrollView.frame.size.width - 40, ...
- 从源码编译rpi的内核
Kernel Building https://www.raspberrypi.org/documentation/linux/kernel/building.md There are two mai ...
- PL/SQL练习
简单结构 set serveroutput on; DECLARE v_name ); BEGIN v_name := 'hello'; dbms_output.put_line(v_name); E ...
- poj 1995 Raising Modulo Numbers【快速幂】
Raising Modulo Numbers Time Limit: 1000MS Memory Limit: 30000K Total Submissions: 5477 Accepted: ...
- MyEclipse中Web项目的发布和运行
1.右键对应项目的名称:MyEclipse|Add and Remove Project Deployments... 2.点击Add按钮,选择Tomcat7.x,Deploy type选择Explo ...
- spring使用ehcache
spring本身内置了对Cache的支持,之前记录的是基于Java API的ConcurrentMap的CacheManager配置,现使用ehcache实现. 1.声明对cache的支持 <b ...
- 制作一个html中闪动的title 来提示消息
var flashTitlePlayer = { start: function (msg) { this.title = document.title; if (!this.action) { tr ...