twsocket@lists.elists.org <twsocket@lists.elists.org>
ICS 8
unit OverbyteIcsWSocket.pas, version 8.06
OS Windows 8.1
Delphi XE5
Target Platform Win32
Hi
I still think that there is an error in
function TCustomWSocket.Send(Data : TWSocketData; Len : Integer) : Integer;
...as there were no answers to my post, I am probably the only one :-) (?)
or I do miss a thing...
________________________________________________________________
Today, I have logged several range check errors in this function - all are
of the same "type":
Entering TCustomWSocket.Send
the values of FState and FHSocket are :
FState = wsConnected FHSocket = <Handle> <> -1
After
TryToSend;
the values are:
FState = wsClosed, FHSocket = -1, bAllSent = true
Given these values => range check error in function function
TCustomWSocket.Send at line:
PostMessage(Handle, FMsg_WM_ASYNCSELECT, FHSocket, IcsMakeLong(FD_WRITE,
0));
reason FHSocket = -1.
________________________________________________________________
What happens in TryToSend ?
if Count = SOCKET_ERROR then begin
LastError := WSocket_Synchronized_WSAGetLastError;
value of count:
Count = -1 (SOCKET_ERROR)
LastError = 10057 (WSAENOTCONN)
=>
Close;
=> FHSocket = -1 FState = wsClosed
________________________________________________________________
I think you should either
- set (in this case) bAllSent to false or
- only post the message (PostMessage(Handle, FMsg_WM_ASYNCSELECT, FHSocket,
IcsMakeLong(FD_WRITE, 0));) if FHSocket <> -1.
________________________________________________________________
Regards
Michael
--
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