Q
qinsir
Unregistered / Unconfirmed
GUEST, unregistred user!
这是我的一个过程:
procedure SendData(SendData:String;UdpServer:TNMUDP;ClientIp:String;Port:integer);
var DataStream:TmemoryStream;
var SendMessage:String;
begin
DataStream:=TmemoryStream.Create;
UdpServer.RemoteHost:=ClientIp;
UdpServer.RemotePort:=Port;
SendMessage:=SendData;
try
DataStream.Write(SendData[1],length(SendData));
UdpServer.SendStream(DataStream);
DataStream.Free;
except
exit;
end;
end;
当用户登陆上来时,调用这个函数发送信息就正确;当用户没有登陆上来,但程序记录了
ip地址,调用该过程就报错,提示是:Datastrem.write error,我做了异常处理呀
帮忙看看
procedure SendData(SendData:String;UdpServer:TNMUDP;ClientIp:String;Port:integer);
var DataStream:TmemoryStream;
var SendMessage:String;
begin
DataStream:=TmemoryStream.Create;
UdpServer.RemoteHost:=ClientIp;
UdpServer.RemotePort:=Port;
SendMessage:=SendData;
try
DataStream.Write(SendData[1],length(SendData));
UdpServer.SendStream(DataStream);
DataStream.Free;
except
exit;
end;
end;
当用户登陆上来时,调用这个函数发送信息就正确;当用户没有登陆上来,但程序记录了
ip地址,调用该过程就报错,提示是:Datastrem.write error,我做了异常处理呀
帮忙看看