IP数据包转发器,帮我看看问题出在那 二天内解答150 (50分)

  • 主题发起人 主题发起人 li2
  • 开始时间 开始时间
L

li2

Unregistered / Unconfirmed
GUEST, unregistred user!
var
Form1: TForm1;
i_count:integer=0;
cs :array[0..100] of tClientSocket;
procedure TForm1.ServerSocket1ClientConnect(Sender: TObject;
Socket: TCustomWinSocket);
var
i:integer;
begin
i:=i_count;
cs:=tClientSocket.Create (self);
cs.tag:=i_count;
i_count :=i_count+1;
memo1.Lines.add('host:'+ Socket .RemoteHost
+'port:'+inttostr(Socket .remoteport)
+'localport'+inttostr(Socket .localport));
cs.Port :=23;
cs.host :='134.103.64.131';
cs.ClientType :=ctNonBlocking;
cs.onread:=ClientSocket1 .onread;
cs.OnDisconnect :=ClientSocket1 .OnDisconnect ;
cs.Active :=true;
end;

procedure TForm1.ServerSocket1ClientRead(Sender: TObject;
Socket: TCustomWinSocket);
var
i:integer;
begin
for i:=0 to i_count do begin
if (ServerSocket1 .Socket .Connections .RemotePort =socket.remotePort )
and (ServerSocket1 .Socket .Connections .LocalHost =socket.localHost ) then
begin
break;
end;
end;
memo1.Lines .add(inttostr(socket.remoteport)+' '+socket.localHost);
memo1.Lines .add(inttostr(ServerSocket1 .Socket .Connections .RemotePort)+' '+
ServerSocket1 .Socket .Connections .LocalHost);
cs.Socket .SendText (Socket .ReceiveText );
end;

procedure TForm1.ClientSocket1Read(Sender: TObject;
Socket: TCustomWinSocket);
var
i:integer;
begin
i:=(sender as TClientSocket ).tag;
ServerSocket1 .Socket .Connections .SendText (Socket .ReceiveText );
end;
 
上面的问题是,当cs.Port :=23.可以代理TELNET.
但PORT 为 80 时就很有问题,我要做的是让该程序转发SQLPLUS的数据包,端口号为1521程序
老是没反应,请问何故.
如要做WEB访问的代理还要注意些什么?
另:程序关闭总有一大堆的错.请问如果写各控件的DISCONNECT 事件,和FORM 的CLOSE 事件
垃圾程序请各位大侠不要笑话,多多指教
 
分不够我再加100 分,各位先帮帮我呀
 
你的转发器搞好了没有,告诉我一下你的工作原理,ok?有代码的话拿就感激不尽,全部分数
赠送 eken@163.com
 
后退
顶部