Harald_TSE 0 Posted October 12, 2023 Hello, we have recently been using the TCP/IP Client Socket in the current version 9.1 for real-time data evaluation. Everything works fine except for a problem in the "Do_FD_CONNECT" method in OverbyteIcsWSocket.pas: The status wsConnected is always set, even if a connection to the server could not be established, i.e. if the ErrorCode from msg.LParam is not equal to 0. To work around the problem, we modified the method as follows: if FState <> wsConnected then begin if IcsHiWord(msg.LParam) = 0 then // query added! ChangeState(wsConnected); TriggerSessionConnectedSpecial(IcsHiWord(msg.LParam)); if (IcsHiWord(msg.LParam) <> 0) and (FState <> wsClosed) then Close; end; Normally this probably doesn't matter that much because the "Close" changes the connection status again, but we need the correct status immediately. Is there anything wrong with officially committing this change to the repository? Share this post Link to post
Angus Robertson 574 Posted October 12, 2023 (edited) Thanks, I've made the change in my copy, but it won't be in SVN for several days until I see if it breaks anything. Generally, applications use specific events like onSessionConnected, Closed, etc to check for errors, rather than the State changing. But if this change proves not to be backward compatible, it will be reverted. ICS itself does not use the OnChangeState event, except for when a server starts listening. Angus Edited October 12, 2023 by Angus Robertson Share this post Link to post