首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > .NET > .NET >

delphi开发的客户端如何无法连接9730端口

2012-03-12 
delphi开发的客户端怎么无法连接9730端口?服务器是一个网络设备,目前在内网,IP固定为192.168.1.123,开放97

delphi开发的客户端怎么无法连接9730端口?
服务器是一个网络设备,目前在内网,IP固定为192.168.1.123,开放9707~9738共31个连续端口(用XP自带的超级终端试过了,这些端口都可以正常连接、通讯)。
用TcpClient控件写的客户端软件,就9730这个端口无法建立连接、通讯,代码如下,程序运行到 “MyTcpClient.Open;”时就报错,MyTcpClient.OnError返回10061和10057两个错误代码。请问是怎么回事?

procedure TFormSMS.E1SendClick(Sender: TObject);
var
  MyTcpClient:TTcpClient;
  ID:DWORD;
  Rec:string;
  index:Integer;
begin
  MyTcpClient :=TTcpClient.Create(nil);
  MyTcpClient.BlockMode := bmBlocking;
  MyTcpClient.Name := 'MyTempTcpClient';
  MyTcpClient.OnError := TcpClient1Error;
  MyTcpClient.RemoteHost := RzEditE1IP.Text;
  MyTcpClient.RemotePort := RzEditE1Port.Text;
MyTcpClient.Open;  
  Sleep(100);
  if MyTcpClient.Active then
  begin
  if MyTcpClient.Sendln(RzEditE1Command.Text) > 0 then
  begin
  ...
  end;
  end;
  MyTcpClient.Close;
  MyTcpClient.Free;
end;


[解决办法]

探讨
或者哪位大师有空,用TcpClient和TcpService写个简单的通讯程序,端口用9730,好像是不行的,我试过。

热点排行