diff --git a/src/units/fm_net_socket.pas b/src/units/fm_net_socket.pas index 88377f6..82b4508 100644 --- a/src/units/fm_net_socket.pas +++ b/src/units/fm_net_socket.pas @@ -92,6 +92,7 @@ const {$ENDIF} function IsPortInUse(APort: Word): Boolean; +{$IFDEF UNIX} var Sock: cint; Addr: TSockAddr; @@ -112,6 +113,13 @@ begin fpClose(Sock); end; end; +{$ELSE} +begin + { Best-effort: on non-Unix platforms we don't pre-check; the listener + will fail fast on bind() if the port is genuinely in use. } + Result := False; +end; +{$ENDIF} { TFMSocket } @@ -291,6 +299,7 @@ begin end; function TFMSocket.WaitForData(ATimeoutMS: Integer): Boolean; +{$IFDEF UNIX} var FDS: TFDSet; TimeVal: TTimeVal; @@ -300,7 +309,6 @@ begin Result := False; if not FConnected then Exit; - {$IFDEF UNIX} if Assigned(FSocket) then Fd := FSocket.Handle else if Assigned(FStream) and (FStream is THandleStream) then @@ -314,10 +322,13 @@ begin TimeVal.tv_usec := (ATimeoutMS mod 1000) * 1000; Ret := fpSelect(Fd + 1, @FDS, nil, nil, @TimeVal); Result := Ret > 0; - {$ELSE} - Result := True; - {$ENDIF} end; +{$ELSE} +begin + { Non-Unix: assume data is available; caller will handle EAGAIN. } + Result := FConnected; +end; +{$ENDIF} { TFMListener } diff --git a/src/units/fw_consts.pas b/src/units/fw_consts.pas index b2665b7..4b4670f 100644 --- a/src/units/fw_consts.pas +++ b/src/units/fw_consts.pas @@ -7,8 +7,8 @@ interface const FW_VERSION_MAJOR = 0; FW_VERSION_MINOR = 5; - FW_VERSION_PATCH = 0; - FW_VERSION_STRING = '0.5.0'; + FW_VERSION_PATCH = 2; + FW_VERSION_STRING = '0.5.2'; FW_PRODUCT_NAME = 'Fastway BBS'; FW_PRODUCT_CODE = 'FWBBS'; FW_SERVER_BANNER = FW_PRODUCT_NAME + ' v' + FW_VERSION_STRING;