L
lxzmm_zy
Unregistered / Unconfirmed
GUEST, unregistred user!
前些天 用delphi7 的MIdas做了个项目,分发给客户使用后,反馈说隔几天,总要死一次机,其实是程序死了,经最后查看源码,发现在每次客户端退出时,在调试状态下scktsrvr.dpr 中总要报告一个错误,具体位置在如下代码段中的“Data := FTransport.Receive(False, 0);处”,经分析,发现是在 FTransport.Receive 的代码中有个语句(
RetLen := FSocket.ReceiveBuf(Sig, SizeOf(Sig));
if RetLen <> SizeOf(Sig) then
raise ESocketConnectionError.CreateRes(@SSocketReadError);
)导致的,但又有点理解不了为啥。
procedure TSocketDispatcherThread.ClientExecute;
......
begin
CoInitialize(nil);
try
....
while not Terminated and FTransport.Connecteddo
try
case MsgWaitForMultipleObjects(1, Event, False, WaitTime, QS_ALLEVENTS) of
WAIT_OBJECT_0:
begin
WSAResetEvent(Event);
Data := FTransport.Receive(False, 0);
.....
Delphi7 中,scktsrvr.dpr 源代码中难道有问题,期待高手解答?
RetLen := FSocket.ReceiveBuf(Sig, SizeOf(Sig));
if RetLen <> SizeOf(Sig) then
raise ESocketConnectionError.CreateRes(@SSocketReadError);
)导致的,但又有点理解不了为啥。
procedure TSocketDispatcherThread.ClientExecute;
......
begin
CoInitialize(nil);
try
....
while not Terminated and FTransport.Connecteddo
try
case MsgWaitForMultipleObjects(1, Event, False, WaitTime, QS_ALLEVENTS) of
WAIT_OBJECT_0:
begin
WSAResetEvent(Event);
Data := FTransport.Receive(False, 0);
.....
Delphi7 中,scktsrvr.dpr 源代码中难道有问题,期待高手解答?