G
goodman123
Unregistered / Unconfirmed
GUEST, unregistred user!
我在用serversocket非阻塞模式读取clientsocket发的信息时出现下面的错误:
“Read error 64, 指定的网络名不再可用”。
代码如下:
MySocketStream := TWinSocketStream.Create(thr, 100000);
while (not Terminated) and ClientSocket.Connected do
begin
//接收报文
if MySocketStream.WaitForData(60000) then
begin
try
FillChar(rcvbuffer, REQUESTSIZE, 0);
MySocketStream.Read(rcvbuffer, REQUESTSIZE); //就是这一句出错的
except on E:exception do
tempTransfer.Writelog('Read error: ' + E.Message);
end;
rcvstring := copy(rcvbuffer,1,REQUESTSIZE); //把rcvbuffer里面的内容专成字符串
end
else
ClientSocket.Close;
end;
高手帮忙啊!
“Read error 64, 指定的网络名不再可用”。
代码如下:
MySocketStream := TWinSocketStream.Create(thr, 100000);
while (not Terminated) and ClientSocket.Connected do
begin
//接收报文
if MySocketStream.WaitForData(60000) then
begin
try
FillChar(rcvbuffer, REQUESTSIZE, 0);
MySocketStream.Read(rcvbuffer, REQUESTSIZE); //就是这一句出错的
except on E:exception do
tempTransfer.Writelog('Read error: ' + E.Message);
end;
rcvstring := copy(rcvbuffer,1,REQUESTSIZE); //把rcvbuffer里面的内容专成字符串
end
else
ClientSocket.Close;
end;
高手帮忙啊!