修改后的socketsvr源码

时间:2013-04-06 07:50:09
【文件属性】:

文件名称:修改后的socketsvr源码

文件大小:42KB

文件格式:RAR

更新时间:2013-04-06 07:50:09

socketsvr,DCOM

修改后的socketsvr源码 function TCustomWinSocket.ReceiveBuf(var Buf; Count: Integer): Integer; var ErrorCode, iCount: Integer; {##Add} begin Lock; try Result := 0; if (Count = -1) and FConnected then ioctlsocket(FSocket, FIONREAD, Longint(Result)) else begin if not FConnected then Exit; if ioctlsocket(FSocket, FIONREAD, iCount) = 0 then {##ADD} begin if iCount < Count then {##ADD} Count := icount; {##ADD} end; Result := recv(FSocket, Buf, Count, 0); if Result = SOCKET_ERROR then begin ErrorCode := WSAGetLastError; if ErrorCode <> WSAEWOULDBLOCK then begin Error(Self, eeReceive, ErrorCode); Disconnect(FSocket); if ErrorCode <> 0 then raise ESocketError.CreateResFmt(@sWindowsSocketError, [SysErrorMessage(ErrorCode), ErrorCode, 'recv']); end; end; end; finally Unlock; end; end;


【文件预览】:
SConnect.pas
ScktCnst.pas
MidConst.pas
Midas.pas
MConnect.pas
ScktSrvr.dpr
MidasCon.pas
ScktMain.dfm
ScktMain.pas
ScktComp.pas

网友评论