DELPHI扫描器出现的问题(100分)

  • 主题发起人 主题发起人 xebaobei
  • 开始时间 开始时间
X

xebaobei

Unregistered / Unconfirmed
GUEST, unregistred user!
unit Unit1;

interface

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

type
TForm1 = class(TForm)
Edit1: TEdit;
Edit2: TEdit;
Button1: TButton;
ClientSocket1: TClientSocket;
ListBox1: TListBox;
ListBox2: TListBox;
ListBox3: TListBox;
procedure Button1Click(Sender: TObject);
procedure linkok(Sender: TObject;Socket: TCustomWinSocket);
procedure linkError(Sender: TObject; Socket: TCustomWinSocket;ErrorEvent: TErrorEvent; var ErrorCode: Integer);
function showip():integer;
procedure FormShow(Sender: TObject);
procedure sao(i:integer);
procedure jia;
private
{ Private declarations }

public
{ Public declarations }
end;

var
Form1: TForm1;
link: array[1..300] of tClientSocket;
ports,f,j: integer;
implementation


{$R *.dfm}

//当连接成功时候 (端口打开)
procedure tform1.linkok(Sender: TObject;Socket: TCustomWinSocket);
var
temp: string;
begin
temp:=inttostr(tClientSocket(sender).Tag);
listbox2.Items.Add(temp+'连接成功');
tClientSocket(sender).Close;
jia;
end;

//当连接错误时候 (端口关闭)
procedure TForm1.linkError(Sender: TObject;
Socket: TCustomWinSocket; ErrorEvent: TErrorEvent;
var ErrorCode: Integer);
begin
errorcode:=0;
tClientSocket(sender).Close;
jia;
end;

//显示扫描到哪里,和在一组线程完毕后从新启动线程
procedure TForm1.jia;
begin
f:=f+1;
j:=j+1;
edit2.text:=inttostr(f);
if f<10000 then
begin
if j=300 then
begin
j:=0;
Button1.Click;
end;
end;
end;

//开始扫描
procedure TForm1.Button1Click(Sender: TObject);
var
i:integer;
begin
Button1.Enabled:=false;
for i:=1 to 300 do
begin
sao(i);
end;
Button1.Enabled:=true;
end;


//得到该扫描哪个端口
function tform1.showip():integer;
begin
result:=ports;
ports:=ports+1;
end;

//当窗口打开时候,
procedure TForm1.FormShow(Sender: TObject);
var
i:integer;
begin
ports:=1; //设置初始端口为1
f:=0;
j:=0;
for i:=1 to 300 do //创建300个clientsock
begin
link:=tClientSocket.Create(self);
link.Name:='link'+inttostr(i);
link.Tag:=i;
link.OnConnect:=linkok;
link.OnError:=linkerror;
end;
end;

//扫描过程
procedure TForm1.sao(i:integer);
var
duan:integer;
begin
duan:=form1.showip;
link.address:=edit1.text;
link.Port:=duan;
link.Open;
listbox1.Items.Add(inttostr(duan)+'试图测试');
end;

end.










windows socket error: 由于系统缓冲空间不足或列队已满,不能执行套接子上的操作。(10055),on API 'connect'
确定


我已经限制tclientsock的个数了啊~
但是还是出那毛病`
还是在3900多时候出那毛病`
555555555555~~~~~~~~~~~~~~~~
112
急救啊~~~
HELP ME。。。。。。。。。。。
 
每次到扫到3900端口时候一定出问题`
就是出

unit Unit1;

interface

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

type
TForm1 = class(TForm)
Edit1: TEdit;
Edit2: TEdit;
Button1: TButton;
ClientSocket1: TClientSocket;
ListBox1: TListBox;
ListBox2: TListBox;
ListBox3: TListBox;
procedure Button1Click(Sender: TObject);
procedure linkok(Sender: TObject;Socket: TCustomWinSocket);
procedure linkError(Sender: TObject; Socket: TCustomWinSocket;ErrorEvent: TErrorEvent; var ErrorCode: Integer);
function showip():integer;
procedure FormShow(Sender: TObject);
procedure sao(i:integer);
procedure jia;
private
{ Private declarations }

public
{ Public declarations }
end;

var
Form1: TForm1;
link: array[1..300] of tClientSocket;
ports,f,j: integer;
implementation


{$R *.dfm}

//当连接成功时候 (端口打开)
procedure tform1.linkok(Sender: TObject;Socket: TCustomWinSocket);
var
temp: string;
begin
temp:=inttostr(tClientSocket(sender).Tag);
listbox2.Items.Add(temp+'连接成功');
tClientSocket(sender).Close;
jia;
end;

//当连接错误时候 (端口关闭)
procedure TForm1.linkError(Sender: TObject;
Socket: TCustomWinSocket; ErrorEvent: TErrorEvent;
var ErrorCode: Integer);
begin
errorcode:=0;
tClientSocket(sender).Close;
jia;
end;

//显示扫描到哪里,和在一组线程完毕后从新启动线程
procedure TForm1.jia;
begin
f:=f+1;
j:=j+1;
edit2.text:=inttostr(f);
if f<10000 then
begin
if j=300 then
begin
j:=0;
Button1.Click;
end;
end;
end;

//开始扫描
procedure TForm1.Button1Click(Sender: TObject);
var
i:integer;
begin
Button1.Enabled:=false;
for i:=1 to 300 do
begin
sao(i);
end;
Button1.Enabled:=true;
end;


//得到该扫描哪个端口
function tform1.showip():integer;
begin
result:=ports;
ports:=ports+1;
end;

//当窗口打开时候,
procedure TForm1.FormShow(Sender: TObject);
var
i:integer;
begin
ports:=1; //设置初始端口为1
f:=0;
j:=0;
for i:=1 to 300 do //创建300个clientsock
begin
link:=tClientSocket.Create(self);
link.Name:='link'+inttostr(i);
link.Tag:=i;
link.OnConnect:=linkok;
link.OnError:=linkerror;
end;
end;

//扫描过程
procedure TForm1.sao(i:integer);
var
duan:integer;
begin
duan:=form1.showip;
link.address:=edit1.text;
link.Port:=duan;
link.Open;
listbox1.Items.Add(inttostr(duan)+'试图测试');
end;

end.










windows socket error: 由于系统缓冲空间不足或列队已满,不能执行套接子上的操作。(10055),on API 'connect'
确定
如何解决

 
后退
顶部