📄 subject_38479.htm
字号:
<p>
序号:38479 发表者:张炫 发表日期:2003-05-03 21:31:31
<br>主题:请问一个UDP包的最大长度
<br>内容:一个最大的包长度是多少?<BR>假如用winsock2的sendto()发送一个包的长度大于一个包最大长度会怎样?<BR><BR>
<br><a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p>
<hr size=1>
<blockquote><p>
回复者:Neil Gan 回复日期:2003-05-03 23:42:11
<br>内容:Why don't you just read the msdn?<BR><BR>Following is what I quoted from msdn->sendto:<BR><BR>The sendto function is used to write outgoing data on a socket. For message-oriented sockets, care must be taken not to exceed the maximum packet size of the underlying subnets, which can be obtained by using getsockopt to retrieve the value of socket option SO_MAX_MSG_SIZE. If the data is too long to pass atomically through the underlying protocol, the error WSAEMSGSIZE is returned and no data is transmitted. <BR><BR>
<br>
<a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p></blockquote>
<hr size=1>
<blockquote><p>
回复者:张炫 回复日期:2003-05-04 16:05:20
<br>内容:I just want to know how long is the SO_MAX_MSG_SIZE, I haven't enought time to check it out.Because I have to send some data,but I'm afraid that the data is <BR>too large to send.just that.
<br>
<a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p></blockquote>
<hr size=1>
<blockquote><p>
回复者:lijb 回复日期:2003-05-05 22:22:50
<br>内容:max 64k,不过用UDP时,一个包不要太大,并且每个包的大小最好一样,否则UDP爱丢包。
<br>
<a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p></blockquote>
<hr size=1>
<blockquote><p>
<font color=red>答案被接受</font><br>回复者:jackyxio 回复日期:2003-05-06 13:21:02
<br>内容:最好保持UDP数据包在1024以内,不要太相信别人的所定的机制!
<br>
<a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p></blockquote>
<hr size=1>
<blockquote><p>
回复者:Neil Gan 回复日期:2003-05-09 08:23:36
<br>内容:If you don't have enough time to solve your problem, how can I have enough time to help you?!<BR>
<br>
<a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p></blockquote>
<hr size=1>
<blockquote><p>
回复者:dzm 回复日期:2003-05-09 22:48:30
<br>内容:1535
<br>
<a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p></blockquote>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -