> When I send data using the send method, XE5 sometimes reports a
RangeCheckError 
> in function TCustomWSocket.Send(Data : TWSocketData; Len : Integer) :
Integer;
> at line
>      PostMessage(Handle,
>                    FMsg_WM_ASYNCSELECT,
>                    FHSocket,
>                    IcsMakeLong(FD_WRITE, 0));
>
> Reason: FHSocket is -1
>
> Maybe it's  by design (?). If you need  further infos then please let me
know.

FHSocket is -1 when the socket has been closed. This is not an issue but to
avoid the error, FHSocket should be cast to WParam like this:

      PostMessage(Handle,
                    FMsg_WM_ASYNCSELECT,
                    WParam(FHSocket),
                    IcsMakeLong(FD_WRITE, 0));

Let me know if it works for you.

-- 
francois.pie...@overbyte.be
Embarcadero MVP
http://www.overbyte.be
http://francois-piette.blogspot.com




-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be

Reply via email to