本文介绍了如何通过套接字发送数据包?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
大家好,我正在玩数据包,到目前为止我能够理解这么好,但我想知道我怎么能发送数据包? 示例包:
Hello all, i am playing around with packets, and i am able to understant so far so good, but i was wondering how can i send packets? Example packet :
0XC1 0X02 0X04我的绕行功能是:
And my function for detour is:
int WINAPI mysend(SOCKET s, BYTE* buf, int len, int flags)请问一个例子?
An example please?
推荐答案unsigned char buf[] = {0XC1 0X02 0X04}; int rc = mysend( sd, buf, sizeof(buf), f); // here check the result code rc
其中 sd 是你的套接字描述符, f 是你的标志。
where sd is your socket descriptor and f are your flags.
更多推荐
如何通过套接字发送数据包?
发布评论