请教高手TCP连接数限制

ccp 2006-08-12 12:50:01
我发现在同时连接100个左右以后的连接就连不上了。究竟是那方面的问题呢?

测试代码:3个文件


=============================
Unit3.pas
============================
unit Unit3;

interface

uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, WSOcket, ComCtrls, StdCtrls;

type
TForm3 = class(TForm)
ListView1: TListView;
Button1: TButton;
procedure FormCreate(Sender: TObject);
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
procedure COnnected(Sender: TObject; error: Word);
public
{ Public declarations }
end;

var
Form3: TForm3;

implementation

{$R *.dfm}

var
Clients: array of TWSocket;

procedure TForm3.COnnected(Sender: TObject; error: Word);
var
li: tlistitem;
begin
li := listView1.FindData(0, Sender, True, True);
if assigned(Li) then
begin
if error <> 0 then
begin
li.SubItems[0] := 'fail:' + Inttostr(error);
end
else
li.subitems[0] := 'ok:';
end;

end;

procedure TForm3.Button1Click(Sender: TObject);
var
I: Integer;
W: twsocket;
begin
for I := 0 to listview1.items.count - 1 do
begin
Clients[I].Addr := listView1.Items[I].Caption;
Clients[I].Port := '7000';
Clients[I].OnSessionConnected := Connected;
Clients[i].Connect;

end;
end;

procedure TForm3.FormCreate(Sender: TObject);
var
Strings: TStrings;
I: Integer;
li: tlistitem;
begin
strings := tstringlist.Create;
strings.LoadFromFile(GetCurrentDir + '\ip.txt');
setlength(clients, strings.count);
for I := 0 to strings.Count - 1 do
begin

Clients[I] := TWSocket.Create(nil);
li := listView1.Items.Add;
li.Caption := strings[i];
li.Data := clients[I];
li.SubItems.Add('');
end;
strings.Free;
end;

end.


======================================
Unit3.dfm
======================================
object Form3: TForm3
Left = 0
Top = 0
Caption = 'Form3'
ClientHeight = 238
ClientWidth = 337
Color = clBtnFace
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'Tahoma'
Font.Style = []
OldCreateOrder = False
OnCreate = FormCreate
PixelsPerInch = 96
TextHeight = 13
object ListView1: TListView
Left = 0
Top = 0
Width = 337
Height = 238
Align = alClient
Columns = <
item
Caption = 'ip'
Width = 120
end
item
Caption = #29366#24577
end>
TabOrder = 0
ViewStyle = vsReport
end
object Button1: TButton
Left = 200
Top = 72
Width = 75
Height = 25
Caption = 'Button1'
TabOrder = 1
OnClick = Button1Click
end
end
...全文
660 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
ccp 2006-08-12
  • 打赏
  • 举报
回复
======================================
ip.txt
=====================================
222.215.152.80
125.90.64.95
59.56.174.5
60.190.243.100
222.178.181.95
218.7.120.72
61.131.15.130
58.215.74.82
202.103.178.185
221.209.108.190
61.154.10.55
125.90.64.7
202.103.213.57
202.105.233.33
125.90.64.46
218.66.102.36
219.153.40.11
61.131.15.145
218.66.102.37
222.178.181.82
218.66.102.102
61.136.195.228
59.34.197.175
125.91.15.143
222.77.178.240
222.215.119.161
61.154.10.60
218.28.104.178
58.215.74.84
221.14.150.145
59.56.174.13
61.128.236.120
59.34.216.210
59.34.216.151
218.76.142.126
202.104.236.158
219.129.239.38
61.136.59.140
61.154.10.57
59.34.196.206
59.34.196.199
218.3.205.100
59.34.197.169
61.131.15.136
61.138.2.30
219.129.239.253
202.104.237.52
202.103.213.210
219.153.18.74
222.217.220.105
59.56.174.8
222.178.150.93
219.153.39.22
222.214.216.115
218.89.13.27
219.153.55.13
218.66.102.57
222.178.181.22
222.214.216.45
222.77.178.8
61.131.15.144
222.189.238.166
60.22.148.9
58.215.75.110
61.136.195.227
218.89.13.30
59.34.148.253
125.91.14.111
218.66.102.35
218.93.202.229
61.154.10.59
61.128.236.168
59.34.197.26
58.66.176.41
59.34.216.211
218.61.28.91
61.155.5.133
219.153.18.55
59.56.174.12
59.34.197.75
222.215.119.150
218.28.104.186
59.34.216.130
60.190.223.165
61.153.44.205
59.34.197.71
59.34.216.85
219.129.239.8
222.188.114.139
221.206.84.109
222.168.9.206
59.34.198.224
221.210.49.58
125.91.14.46
219.153.40.191
218.92.169.172
222.214.216.123
218.71.141.230
60.22.148.50
219.153.39.37
219.129.239.158
222.77.187.220
61.128.236.40
219.129.239.217
59.34.216.145
58.215.74.200
221.14.150.131
59.34.197.140
218.16.223.63
60.190.90.15
59.34.216.68
60.190.249.66
58.215.75.141
222.178.181.201
219.153.40.143
219.129.21.87
219.153.19.56
125.91.14.95
125.90.64.97
222.214.216.22
61.153.38.66
218.57.240.148
219.129.237.33
222.77.178.17
219.146.171.235
219.153.22.60
59.34.198.189
60.28.21.109
221.14.150.136
219.147.35.21
61.139.175.48
58.215.78.61
61.155.7.136
222.73.4.123
58.215.79.56
58.215.78.25
59.34.216.191
59.34.216.77
219.133.49.146
61.128.236.244
218.94.124.162
219.129.216.214
58.221.246.88
58.221.246.103
59.34.196.117
218.83.161.160
59.34.196.47
219.129.239.84
219.153.45.120
222.208.183.212
58.221.246.47
59.34.197.69
221.5.41.14
59.34.196.130
59.34.148.158
58.221.254.233
58.221.254.76
125.64.95.25
58.221.246.25
61.155.5.130
219.153.18.30
219.153.34.11
222.77.187.203
219.153.15.78
219.129.239.199
202.104.236.238
59.34.216.139
202.103.213.19
60.191.150.134
58.221.246.27
219.153.55.27
125.91.14.206
221.233.134.193
59.34.197.114
222.179.185.122
59.34.216.174
58.215.76.199
219.153.17.169
219.153.19.83
218.23.55.50
219.153.12.24
218.93.203.53
219.149.225.51
218.57.209.130
220.114.101.28
61.152.239.90
59.51.27.21
61.143.211.46
221.215.83.142
222.190.10.192
218.59.175.16
60.172.80.142
218.12.184.130
221.227.198.178
222.189.228.145
222.170.60.28
222.217.221.148
59.34.196.79
59.34.196.197
219.149.64.153
60.28.20.60
125.91.14.17
218.64.95.70
222.191.77.233
60.190.249.104
222.180.76.254
61.188.38.123
222.188.114.144
222.84.227.46
221.227.199.222
221.229.149.246
125.90.88.75
219.153.45.46
107.0.0.1
61.130.11.116
222.178.216.86
218.24.127.150
219.153.36.23
218.92.50.201
221.7.103.53
125.91.15.142
60.190.87.79
218.75.184.190
58.215.75.107
218.22.171.42
60.184.1.228
59.34.196.1
222.189.237.32
218.74.1.16
218.5.76.45
218.28.62.170
218.83.160.74
202.97.170.119
60.30.249.60
220.164.152.109
61.136.59.18
219.153.37.69
60.190.223.29
219.153.14.109
219.129.220.121
218.16.223.58
59.34.197.53
222.77.187.248
219.153.15.89
61.191.222.182
219.153.45.41
219.153.40.29
202.75.214.215
59.34.196.169
219.153.37.190
218.22.87.101
219.153.40.51
219.153.45.35
59.34.216.138
219.153.45.137
219.129.239.233
220.248.245.38
218.16.223.53
219.153.18.88
61.156.240.39
58.215.78.62
59.34.196.226
222.179.185.68
59.34.148.198
59.34.197.77
218.22.86.171
218.94.124.168
220.248.245.42
61.155.5.76
61.155.5.14
59.34.197.106
125.91.14.54
58.221.254.252
218.16.223.130
222.188.62.116
61.175.203.246
59.34.216.117
58.215.78.97
58.215.78.54
219.153.45.162
221.122.0.70
58.215.78.14
221.192.132.93
218.61.28.70
221.203.168.92
221.14.150.137
ccp 2006-08-12
  • 打赏
  • 举报
回复
问题已解决。确实是受到了限制,包括ADSL MODEL的内置防火墙也要设置。
谢谢各位的参与。
gyf 2006-08-12
  • 打赏
  • 举报
回复
windows的连接数限制,破解就好了
erhan 2006-08-12
  • 打赏
  • 举报
回复
并发连接数做了限制
下载这个破解试一下的
http://www.lvllord.de/download.php?url=en/EvID4226Patch223d-en.zip
ccp 2006-08-12
  • 打赏
  • 举报
回复
Win2003se sp1
4m ADSL
erhan 2006-08-12
  • 打赏
  • 举报
回复
用的什么系统,sp的版本是什么?

1,593

社区成员

发帖
与我相关
我的任务
社区描述
Delphi 网络通信/分布式开发
社区管理员
  • 网络通信/分布式开发社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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