udt-问题解决
来源:互联网 发布:淘宝被买家诈骗怎么办 编辑:程序博客网 时间:2024/05/16 15:35
Q:
when my client computers connect server, 1 or 2 computers always
say "abort for security reasons".
i cannot find any firewall in the computer,and other computer is right.
please do me a favor, what reason is it?
thanks for your help!
W:
The only reason to cause this error is that the client received a wrong response
from the server. The response UDP packet may be changed or damaged somewhere in
the middle.
解决:
之前的包头说明:key为随机的四子节秘钥
#pragma pack(1)
struct UDPHead{
char flag;
short bodylen;
char key[4]; //now used 4 bytes
char other[9];
};
#pragma pack()
core.cpp
void CUDT::connect(const sockaddr* serv_addr)
中
int CHandShake::serialize(char* buf, int& size)
udt数据是head+data
int32_t m_iVersion; // UDT version
int32_t m_iType; // UDT socket type
int32_t m_iISN; // random initial sequence number
int32_t m_iMSS; // maximum segment size
int32_t m_iFlightFlagSize; // flow control window size
int32_t m_iReqType; // connection request type: 1: regular connection request, 0: rendezvous connection request, -1/-2: response
int32_t m_iID; // socket ID
int32_t m_iCookie; // cookie
uint32_t m_piPeerIP[4]; // The IP address that the peer's UDP port is bound to
#pragma pack(1)
struct UDPHead{
char flag;
short bodylen;
char other[9];
char key[4]; //now used 4 bytes
};
#pragma pack()
when my client computers connect server, 1 or 2 computers always
say "abort for security reasons".
i cannot find any firewall in the computer,and other computer is right.
please do me a favor, what reason is it?
thanks for your help!
W:
The only reason to cause this error is that the client received a wrong response
from the server. The response UDP packet may be changed or damaged somewhere in
the middle.
解决:
之前的包头说明:key为随机的四子节秘钥
#pragma pack(1)
struct UDPHead{
char flag;
short bodylen;
char key[4]; //now used 4 bytes
char other[9];
};
#pragma pack()
core.cpp
void CUDT::connect(const sockaddr* serv_addr)
中
int CHandShake::serialize(char* buf, int& size)
udt数据是head+data
int32_t m_iVersion; // UDT version
int32_t m_iType; // UDT socket type
int32_t m_iISN; // random initial sequence number
int32_t m_iMSS; // maximum segment size
int32_t m_iFlightFlagSize; // flow control window size
int32_t m_iReqType; // connection request type: 1: regular connection request, 0: rendezvous connection request, -1/-2: response
int32_t m_iID; // socket ID
int32_t m_iCookie; // cookie
uint32_t m_piPeerIP[4]; // The IP address that the peer's UDP port is bound to
该函数中发送包之后会接收对方的数据包则调用
int CUDT::connect(const CPacket& response) throw (){
if ((1 != response.getFlag()) || (0 !=response.getType()))
return -1;
}
就相当于A主动去connect B,而B用UDP发来个不符合要求的数据包,这样就冲突了,悲剧了。
因此前8字节最好别动,因为存在m_iType,所以改后的数据包为#pragma pack(1)
struct UDPHead{
char flag;
short bodylen;
char other[9];
char key[4]; //now used 4 bytes
};
#pragma pack()
0 0
- udt-问题解决
- UDT
- UDT 介绍
- RUDP & UDT
- UDT协议
- UDT简介
- UDT简介
- UDT复用器
- UDT 分析
- UDT摘记
- UDT 源码分析
- UDT中select异常
- udt代码初探
- UDT协议详细介绍
- C#调用UDT
- 移植UDT到android
- udt4 VS udt gateway
- UDT报错
- 坚持你的梦想,什么时候都不晚!
- VC++获得当前系统时间的几种方案
- 第四周-项目四-拓展二-文件与工资操作
- 双重检查锁定及单例模式(ibm社区)
- 9.8 VS qt的ui变量的调用
- udt-问题解决
- 长方柱类
- ecshop后台管理员登陆显示商品列表价格不同
- 三角形类2
- UVA 11205 - The broken pedometer 暴力 二进制表示状态
- ClientDataSet
- NOR FLASH 和NAND FLASH 问题
- 关于html中table单元格的填充
- JavaScript trim函数大赏