Menu

#7 TBlockSocket.ExceptCheck()

open
nobody
None
5
2010-07-22
2010-07-22
g2mk
No

Assuming that I can do ResetLastError() in OnStatus event hanler (e.g. when Reason is HR_Error, and LastError is WSAEISCONN) it would be nice to modify TBlockSocket.ExceptCheck() a little.

procedure TBlockSocket.ExceptCheck;
var
e: ESynapseError;
begin
FLastErrorDesc := GetErrorDescEx;
if (LastError <> 0) and (LastError <> WSAEINPROGRESS)
and (LastError <> WSAEWOULDBLOCK) then
begin
DoStatus(HR_Error, IntToStr(FLastError) + ',' + FLastErrorDesc);
if FRaiseExcept then // suggested modification: if FRaiseExcept and (FLastError <> 0) then
begin
e := ESynapseError.Create(Format('Synapse TCP/IP Socket error %d: %s',
[FLastError, FLastErrorDesc]));
e.ErrorCode := FLastError;
e.ErrorMessage := FLastErrorDesc;
raise e;
end;
end;
end;

Discussion


Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.