请问win2000中socket的默认缓冲区大小是多少??

zws101 2003-04-17 12:15:45
如题。
...全文
855 22 打赏 收藏 转发到动态 举报
写回复
用AI写文章
22 条回复
切换为时间正序
请发表友善的回复…
发表回复
DaMimit 2003-06-22
  • 打赏
  • 举报
回复
回复人: warton(转型中...) ( ) 信誉:135 2003-6-19 22:01:09 得分:0

ip包好像是略小于64K,而ipx等的包才是64K!

//========================================

楼上的略小于是什么意识?怎么会略小?



BCBChina 2003-06-21
  • 打赏
  • 举报
回复
64K
yuanhen 2003-06-19
  • 打赏
  • 举报
回复

参考MSDN的IP Helper部分(bcb的帮助中是没有这部分内容的)
下面是一部分摘要(MSDN 2003.4版)
Platform SDK: IP Helper
About IP Helper

Internet Protocol Helper (IP Helper) assists network administration of the local computer by enabling applications to retrieve information about the network configuration of the local computer, and to modify that configuration. IP Helper also provides notification mechanisms to ensure that an application is notified when certain aspects of the local computer network configuration change.


Many of the IP Helper functions pass structure parameters that represent data types associated with the Management Information Base technology. The IP Helper functions use these structures to represent various networking information, such as ARP cache entries. Since these structures are also used by the MIB API, they are described in the Management Information Base Reference. Although the IP Helper API uses these structures, IP Helper is distinct from the Management Information Base (MIB) and Simple Network Management Protocol (SNMP).

IP Helper provides capabilities in the following areas:


Retrieving Information About Network Configuration
Managing Network Adapters
Managing Interfaces
Managing IP Addresses
Using the Address Resolution Protocol
Retrieving Information on the Internet Protocol and the Internet Control Message Protocol
Managing Routing
Receiving Notification of Network Events
Retrieving Information About the Transmission Control Protocol and the User Datagram Protocol

pp616 2003-06-19
  • 打赏
  • 举报
回复
要那么大的缓冲有实际意义吗?
warton 2003-06-19
  • 打赏
  • 举报
回复
查了一个:
ip:65467
ipx/spx:576
netbios:64K(65535)
appletalk:64K
warton 2003-06-19
  • 打赏
  • 举报
回复
ip包好像是略小于64K,而ipx等的包才是64K!
netying 2003-06-19
  • 打赏
  • 举报
回复
好象是一次发8192字节
yesry 2003-06-17
  • 打赏
  • 举报
回复
我试过UDP的缓冲区最大32K。
叶子哟 2003-06-17
  • 打赏
  • 举报
回复
我最近用bcb的那两个socket控件通信,一般发的时候没有什么限制,可以设定(有超过64K的),但接的时候,它会自己分包,所以收的时候比较麻烦一些
webmin 2003-06-17
  • 打赏
  • 举报
回复
ping用的是ICMP的协议
ppgo 2003-04-20
  • 打赏
  • 举报
回复
默认应该是8192吧
ybluo 2003-04-20
  • 打赏
  • 举报
回复
1.IP首部用16位来表示IP包的长度,所以IP包最大限制是2^16即64K。
2.Socket缓冲区分为接收缓冲和发送缓冲,默认值分别如下,在winsock2.h中定义。
#define SO_SNDBUF 0x1001 /* send buffer size */
#define SO_RCVBUF 0x1002 /* receive buffer size */
NowCan 2003-04-18
  • 打赏
  • 举报
回复
建议去查《Windows网络编程》,我好像在那书上看到过。

IP包最大限制是8192?????
ping的时候是不是一个ip包?
可以达到64000字节的。
netsys2 2003-04-18
  • 打赏
  • 举报
回复
而且IP包最大限制应为64K吧
------->肯定是8192!
zws101 2003-04-17
  • 打赏
  • 举报
回复
另外,怎样可以修改该缓冲区大小,是在注册表里吗??
Lo 2003-04-17
  • 打赏
  • 举报
回复
呀,myy()更快一步,不过看了他的代码我发现我的代码有点错误,
要把那(int *)改成(char *)才行。
呵。不好意思,我是现学现卖的。
Lo 2003-04-17
  • 打赏
  • 举报
回复
刚才查了一下书。
Socket缓冲区是分为,接收缓冲和发送缓冲的。
接收缓冲可以直接设置大小,用

int maxsize=1024;
setsockopt(socket,SOL_SOCKET,SO_RCVBUF,(int *)&maxsize,sizeof(int));

发送缓冲区大小:
int maxsize=1024;
setsockopt(socket,SOL_SOCKET,SO_SNDBUF,(int *)&maxsize,sizeof(int));

我是参考书上的,没试过,不知道能不能成功。

另外,也可以把缓冲区的大小设置成0,这样数据就不会通过内存来复制一次,在一定的情况下会提高性能。不过通常都不这样做。
myy 2003-04-17
  • 打赏
  • 举报
回复
缓冲区最大好象是64K,修改可以用:

int bufsize=64*1024;
int err;
err=setsockopt(UDP->ThisSocket,SOL_SOCKET,SO_RCVBUF,(char*)(&bufsize),sizeof(int));
if(0!=err)
MessageBox(Handle,AnsiString(err).c_str(),"提示信息",MB_OK|MB_ICONERROR);

不过好象作用并不大 :(
Lo 2003-04-17
  • 打赏
  • 举报
回复
好像可以修改的,有空我帮你找找资料。
zws101 2003-04-17
  • 打赏
  • 举报
回复
没人知道吗?
不会吧
加载更多回复(2)

1,316

社区成员

发帖
与我相关
我的任务
社区描述
C++ Builder 网络及通讯开发
社区管理员
  • 网络及通讯开发社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧