Re: [twsocket] RES: Compiling with SSL active changes socket behavior
> So I think they are on holliday. No, the elists.org mailing list took a three week holiday to move servers, second time this year, without telling us first. It seems to caught up now, and all outstanding questions were answered this morning. Angus -- 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
Re: [twsocket] Compiling with SSL active changes socket behavior
Just answering cos no one else has... sorry if I don't answer your question. I would guess the showmodal/etc. is 'locking' the message queue because you calling it from within a socket event. From my investigations I can suggest: move the socket processing to its own thread and only process GUI items in the main thread. OR Generate another GUI event in your socket event that your app message queue can pick up to then display the message/form and keep GUI processing out of your socket event handlers. I would think the second item is easier than the first, although both amount to the same thing - freeing up the socket message queue to carry on processing by finishing the socket event. HTH Stephen Dickason Senior Developer - Managed Services Email: sdicka...@elcb.co.za ELCB Information Services (Pty) Ltd Customer Service Email e...@elcb.co.za · www.elcb.co.za E A S T L O N D O N Tel: +27(43) 704 0700 Fax: +27(43) 704 0701 J O H A N N E S B U R G Tel: +27(11) 879 6179 Fax: +27(11) 454 0384 P O R T E L I Z A B E T H Tel: +27(41) 373 0529 Fax: +27(86) 650 0135 Disclaimer > -Original Message- > From: TWSocket [mailto:twsocket-boun...@lists.elists.org] On Behalf Of Éric > Fleming Bonilha > Sent: Tuesday, August 16, 2016 0:08 > To: ICS support mailing > Subject: Re: [twsocket] Compiling with SSL active changes socket behavior > > Could anyone check this? Or at least acknowledge that it was received? > > Thanks > > > > On Sat, Aug 13, 2016 at 3:13 PM, Éric Fleming Bonilha> wrote: > > > I evaluated a little more on this behavior and realized that actually > > many many parts of our software will open a SHOWMODAL dialog to the > > response of a message from the server, that is parsed with our > > protocol parser from within the OnDataAvailable event of the socket, > > and this behavior completely broken our software because now everytime > > it opens a form from within the dataavailable event (indirectly), the > > socket will no longer process any more messages while the form is > > open, and I guess that this is wrong... > > > > Since ICS is designed to be asynchronous it should not prevent me from > > opening a form using showmodal as a response of a socket message... > > > > Just to make clear, I'm using a PLAIN TCP socket without SSL > > > > Well, researching a little more on the issue I found this: > > > > procedure TCustomSslWSocket.Do_FD_READ(var Msg: TMessage); var > > Len: Integer; // How much to receive > > Buffer : array [0..(SSL_BUFFER_SIZE * 2) -1] of AnsiChar; > > NumRead: Integer; > > nError : Integer; > > Res: Integer; > > PBuf : TWSocketData; > > Dummy : Byte; > > begin > > { V8.22 moved here from Do_SSL_FD_READ } > > WSocket_Synchronized_WSAASyncSelect({$IFDEF POSIX}Self,{$ENDIF} > > FHSocket, Handle, FMsg_WM_ASYNCSELECT, FD_WRITE or FD_CLOSE > > or FD_CONNECT); > > try > > if (not FSslEnable) or (FSocksState <> socksData) or > >(FHttpTunnelState <> htsData) then begin > > inherited Do_FD_READ(msg); > > Exit; > > end; > > > > > > > > The problem seems to be with this first call from > > CustomSslWSocket.Do_FD_READ: > > WSocket_Synchronized_WSAASyncSelect({$IFDEF POSIX}Self,{$ENDIF} > > FHSocket, Handle, FMsg_WM_ASYNCSELECT, FD_WRITE or FD_CLOSE or > > FD_CONNECT); > > > > If I just comment out this routine, then the problem is solved but I > > guess that SSL will not work (I'm not using SSL at this moment anyway) > > > > In my point of view, if I'm using a plain socket without SSL, this > > TCustomSslWSocket class should NOT interfere with the operation of the > > socket and should just call inherited Do_FD_READ in case SSL is not > > being used instead of calling some socket routine... > > > > Would someone please look into this issue? I can make some example > > application to demonstrate the behavior (I just don't know how to > > properly fix it) > > > > Thanks > > > > > > > > On Sat, Aug 13, 2016 at 2:50 PM, Éric Fleming Bonilha < > > e...@digifort.com.br> wrote: > > > >> Hi > >> > >> I recently came across an issue with our software after updating to > >> ICS > >> 8.26 > >> > >> We previously used ICS 8.06 and its default compiling directives did > >> not add SSL support, but 8.26 by default activates SSL and makes > >> TWSocket class to be derived from SSL socket > >> > >> I don't know if the problem is related to the SSL socket derivation > >> but probably yes since deactivating SSL will make socket behave like > >> before, which makes me think that could be a bug because socket > >> behavior should not change because I activated SSL (even though I > >> don't use it now, our project will require it later) > >> > >> So, basically the issue is in a message loop processing I guess > >> > >> In our CLIENT application there is a code that opens a form using > >> SHOWMODAL when it receives a message from the
Re: [twsocket] [bcc32 Error] OverbyteIcsWSocket.hpp(2649): E2222 Macro expansion too long
> E Macro expansion too long > This seems to be a huge define for sslRootCACertsBundle in the > machine generated OverbyteIcsWSocket.hpp file We discussed this my email, while the mailing list was stalled, I'll reduce the constant size so it compiles in C++ again. Commenting it out with /* */ works temporarily. Ideally some of this stuff should be moved to new units, but that means updating and testing dozens of packages and I know from experience that two days disappears. Angus -- 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
Re: [twsocket] Post a file from C++ program to PHP server
> What is the component most adapted to upload a .xml file to a PHP > server folder with the POST method? > Is there an example somewhere ? >From the readme: OverbyteIcsHttpPg.dpr Example of THttpCli component (POST to CGI script) OverbyteIcsHttpPost.dpr Example of THttpCli component (POST), work with WebServ sample Angus -- 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
Re: [twsocket] Compiling with SSL active changes socket behavior
> our software will open a SHOWMODAL dialog to the response of > a message from the server, that is parsed with our protocol > parser from within the OnDataAvailable event of the socket, and > this behavior completely broken our software because now > everytime it opens a form from within the dataavailable event > (indirectly), the socket will no longer process any more messages > while the form is open, and I guess that this is wrong... We have always said any processing within ICS event handlers will stop further data being processed. Calling a modal dialog is a blocking event, so I'm surprised your application ever worked, rather than it's stopped working. A better solution would be to post a message that opens the window, so the event handler continues processing. Not quite sure why the V8.22 change in wsocket made this change, but it was an important bug fix that preventing ICS locking up on heavy traffic, so very reluctant to change it. I think I saw this problem in one of my own applications a few days ago, when a log window was opened, it's on my list to investigate. Angus -- 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
[twsocket] RES: Compiling with SSL active changes socket behavior
Nobody is receiving these e-mails?? De: Éric Fleming Bonilha [mailto:e...@digifort.com.br] Enviada em: Monday, August 15, 2016 7:08 PM Para: ICS support mailing Assunto: Re: Compiling with SSL active changes socket behavior Could anyone check this? Or at least acknowledge that it was received? Thanks On Sat, Aug 13, 2016 at 3:13 PM, Éric Fleming Bonilhawrote: I evaluated a little more on this behavior and realized that actually many many parts of our software will open a SHOWMODAL dialog to the response of a message from the server, that is parsed with our protocol parser from within the OnDataAvailable event of the socket, and this behavior completely broken our software because now everytime it opens a form from within the dataavailable event (indirectly), the socket will no longer process any more messages while the form is open, and I guess that this is wrong... Since ICS is designed to be asynchronous it should not prevent me from opening a form using showmodal as a response of a socket message... Just to make clear, I'm using a PLAIN TCP socket without SSL Well, researching a little more on the issue I found this: procedure TCustomSslWSocket.Do_FD_READ(var Msg: TMessage); var Len: Integer; // How much to receive Buffer : array [0..(SSL_BUFFER_SIZE * 2) -1] of AnsiChar; NumRead: Integer; nError : Integer; Res: Integer; PBuf : TWSocketData; Dummy : Byte; begin { V8.22 moved here from Do_SSL_FD_READ } WSocket_Synchronized_WSAASyncSelect({$IFDEF POSIX}Self,{$ENDIF} FHSocket, Handle, FMsg_WM_ASYNCSELECT, FD_WRITE or FD_CLOSE or FD_CONNECT); try if (not FSslEnable) or (FSocksState <> socksData) or (FHttpTunnelState <> htsData) then begin inherited Do_FD_READ(msg); Exit; end; The problem seems to be with this first call from CustomSslWSocket.Do_FD_READ: WSocket_Synchronized_WSAASyncSelect({$IFDEF POSIX}Self,{$ENDIF} FHSocket, Handle, FMsg_WM_ASYNCSELECT, FD_WRITE or FD_CLOSE or FD_CONNECT); If I just comment out this routine, then the problem is solved but I guess that SSL will not work (I'm not using SSL at this moment anyway) In my point of view, if I'm using a plain socket without SSL, this TCustomSslWSocket class should NOT interfere with the operation of the socket and should just call inherited Do_FD_READ in case SSL is not being used instead of calling some socket routine... Would someone please look into this issue? I can make some example application to demonstrate the behavior (I just don't know how to properly fix it) Thanks On Sat, Aug 13, 2016 at 2:50 PM, Éric Fleming Bonilha wrote: Hi I recently came across an issue with our software after updating to ICS 8.26 We previously used ICS 8.06 and its default compiling directives did not add SSL support, but 8.26 by default activates SSL and makes TWSocket class to be derived from SSL socket I don't know if the problem is related to the SSL socket derivation but probably yes since deactivating SSL will make socket behave like before, which makes me think that could be a bug because socket behavior should not change because I activated SSL (even though I don't use it now, our project will require it later) So, basically the issue is in a message loop processing I guess In our CLIENT application there is a code that opens a form using SHOWMODAL when it receives a message from the server (Client is connected to server using our own protocol). As you probably know, SHOWMODAL will create a windows message loop so application can keep processing windows messsages. The problem is that apparently when compiling with SSL, when I call a showmodal from my protocol parser (that is called from OnDataAvailable) basically making showmodal being indirectly called from within the event handler of socket OnDataAvailable, it will not process any more socket messages while my form is open, although the application keeps processing all other windows messages it looks like any socket message (at least data rcv messages) are no longer being processed and my socket gets "hang" while form called with SHOWMODAL is open. This behavior occurs only when activating SSL, but if I deactivate SLL support it will work just fine, and while my form is open with showmodal, the socket still keeps processing new messages (from within the message loop created by showmodal calling). I guess I know I should not indirectly block OnDataAvailable event handler by calling a showmodal because of show it works (creates a new message loop and things can get messy), but this works just fine without the USE_SSL define, so, I would like to understand why this happens. I could just disable USE_SSL for now, but I know I will soon need this is our future
[twsocket] sslRootCACertsBundle is tool long for C++Builder XE
Hi, I try to compile revision r1281 of ICS but the sslRootCACertsBundle it to long for C++Builder XE. When I try to use it I get error message [BCC32 Error] OverbyteIcsWSocket.hpp(2683): E Macro expansion too long The limitation for macro in C++ is 4096 characters. Any idea to overcome this in future release of ICS? Best Regards, Macma -- 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
Re: [twsocket] Compiling with SSL active changes socket behavior
Could anyone check this? Or at least acknowledge that it was received? Thanks On Sat, Aug 13, 2016 at 3:13 PM, Éric Fleming Bonilhawrote: > I evaluated a little more on this behavior and realized that actually many > many parts of our software will open a SHOWMODAL dialog to the response of > a message from the server, that is parsed with our protocol parser from > within the OnDataAvailable event of the socket, and this behavior > completely broken our software because now everytime it opens a form from > within the dataavailable event (indirectly), the socket will no longer > process any more messages while the form is open, and I guess that this is > wrong... > > Since ICS is designed to be asynchronous it should not prevent me from > opening a form using showmodal as a response of a socket message... > > Just to make clear, I'm using a PLAIN TCP socket without SSL > > Well, researching a little more on the issue I found this: > > procedure TCustomSslWSocket.Do_FD_READ(var Msg: TMessage); > var > Len: Integer; // How much to receive > Buffer : array [0..(SSL_BUFFER_SIZE * 2) -1] of AnsiChar; > NumRead: Integer; > nError : Integer; > Res: Integer; > PBuf : TWSocketData; > Dummy : Byte; > begin > { V8.22 moved here from Do_SSL_FD_READ } > WSocket_Synchronized_WSAASyncSelect({$IFDEF POSIX}Self,{$ENDIF} > FHSocket, Handle, FMsg_WM_ASYNCSELECT, FD_WRITE or FD_CLOSE or > FD_CONNECT); > try > if (not FSslEnable) or (FSocksState <> socksData) or >(FHttpTunnelState <> htsData) then begin > inherited Do_FD_READ(msg); > Exit; > end; > > > > The problem seems to be with this first call from > CustomSslWSocket.Do_FD_READ: > WSocket_Synchronized_WSAASyncSelect({$IFDEF POSIX}Self,{$ENDIF} > FHSocket, Handle, FMsg_WM_ASYNCSELECT, FD_WRITE or FD_CLOSE or FD_CONNECT); > > If I just comment out this routine, then the problem is solved but I guess > that SSL will not work (I'm not using SSL at this moment anyway) > > In my point of view, if I'm using a plain socket without SSL, > this TCustomSslWSocket class should NOT interfere with the operation of the > socket and should just call inherited Do_FD_READ in case SSL is not being > used instead of calling some socket routine... > > Would someone please look into this issue? I can make some example > application to demonstrate the behavior (I just don't know how to properly > fix it) > > Thanks > > > > On Sat, Aug 13, 2016 at 2:50 PM, Éric Fleming Bonilha < > e...@digifort.com.br> wrote: > >> Hi >> >> I recently came across an issue with our software after updating to ICS >> 8.26 >> >> We previously used ICS 8.06 and its default compiling directives did not >> add SSL support, but 8.26 by default activates SSL and makes TWSocket class >> to be derived from SSL socket >> >> I don't know if the problem is related to the SSL socket derivation but >> probably yes since deactivating SSL will make socket behave like before, >> which makes me think that could be a bug because socket behavior should not >> change because I activated SSL (even though I don't use it now, our project >> will require it later) >> >> So, basically the issue is in a message loop processing I guess >> >> In our CLIENT application there is a code that opens a form using >> SHOWMODAL when it receives a message from the server (Client is connected >> to server using our own protocol). As you probably know, SHOWMODAL will >> create a windows message loop so application can keep processing windows >> messsages. The problem is that apparently when compiling with SSL, when I >> call a showmodal from my protocol parser (that is called from >> OnDataAvailable) basically making showmodal being indirectly called from >> within the event handler of socket OnDataAvailable, it will not process any >> more socket messages while my form is open, although the application keeps >> processing all other windows messages it looks like any socket message (at >> least data rcv messages) are no longer being processed and my socket gets >> "hang" while form called with SHOWMODAL is open. >> >> This behavior occurs only when activating SSL, but if I deactivate SLL >> support it will work just fine, and while my form is open with showmodal, >> the socket still keeps processing new messages (from within the message >> loop created by showmodal calling). >> >> I guess I know I should not indirectly block OnDataAvailable event >> handler by calling a showmodal because of show it works (creates a new >> message loop and things can get messy), but this works just fine without >> the USE_SSL define, so, I would like to understand why this happens. >> >> I could just disable USE_SSL for now, but I know I will soon need this is >> our future release and I just want to understand why this socket behavior >> changed and what should be the "correct" way of working with it >>
Re: [twsocket] Compiling with SSL active changes socket behavior
I evaluated a little more on this behavior and realized that actually many many parts of our software will open a SHOWMODAL dialog to the response of a message from the server, that is parsed with our protocol parser from within the OnDataAvailable event of the socket, and this behavior completely broken our software because now everytime it opens a form from within the dataavailable event (indirectly), the socket will no longer process any more messages while the form is open, and I guess that this is wrong... Since ICS is designed to be asynchronous it should not prevent me from opening a form using showmodal as a response of a socket message... Just to make clear, I'm using a PLAIN TCP socket without SSL Well, researching a little more on the issue I found this: procedure TCustomSslWSocket.Do_FD_READ(var Msg: TMessage); var Len: Integer; // How much to receive Buffer : array [0..(SSL_BUFFER_SIZE * 2) -1] of AnsiChar; NumRead: Integer; nError : Integer; Res: Integer; PBuf : TWSocketData; Dummy : Byte; begin { V8.22 moved here from Do_SSL_FD_READ } WSocket_Synchronized_WSAASyncSelect({$IFDEF POSIX}Self,{$ENDIF} FHSocket, Handle, FMsg_WM_ASYNCSELECT, FD_WRITE or FD_CLOSE or FD_CONNECT); try if (not FSslEnable) or (FSocksState <> socksData) or (FHttpTunnelState <> htsData) then begin inherited Do_FD_READ(msg); Exit; end; The problem seems to be with this first call from CustomSslWSocket.Do_FD_READ: WSocket_Synchronized_WSAASyncSelect({$IFDEF POSIX}Self,{$ENDIF} FHSocket, Handle, FMsg_WM_ASYNCSELECT, FD_WRITE or FD_CLOSE or FD_CONNECT); If I just comment out this routine, then the problem is solved but I guess that SSL will not work (I'm not using SSL at this moment anyway) In my point of view, if I'm using a plain socket without SSL, this TCustomSslWSocket class should NOT interfere with the operation of the socket and should just call inherited Do_FD_READ in case SSL is not being used instead of calling some socket routine... Would someone please look into this issue? I can make some example application to demonstrate the behavior (I just don't know how to properly fix it) Thanks On Sat, Aug 13, 2016 at 2:50 PM, Éric Fleming Bonilhawrote: > Hi > > I recently came across an issue with our software after updating to ICS > 8.26 > > We previously used ICS 8.06 and its default compiling directives did not > add SSL support, but 8.26 by default activates SSL and makes TWSocket class > to be derived from SSL socket > > I don't know if the problem is related to the SSL socket derivation but > probably yes since deactivating SSL will make socket behave like before, > which makes me think that could be a bug because socket behavior should not > change because I activated SSL (even though I don't use it now, our project > will require it later) > > So, basically the issue is in a message loop processing I guess > > In our CLIENT application there is a code that opens a form using > SHOWMODAL when it receives a message from the server (Client is connected > to server using our own protocol). As you probably know, SHOWMODAL will > create a windows message loop so application can keep processing windows > messsages. The problem is that apparently when compiling with SSL, when I > call a showmodal from my protocol parser (that is called from > OnDataAvailable) basically making showmodal being indirectly called from > within the event handler of socket OnDataAvailable, it will not process any > more socket messages while my form is open, although the application keeps > processing all other windows messages it looks like any socket message (at > least data rcv messages) are no longer being processed and my socket gets > "hang" while form called with SHOWMODAL is open. > > This behavior occurs only when activating SSL, but if I deactivate SLL > support it will work just fine, and while my form is open with showmodal, > the socket still keeps processing new messages (from within the message > loop created by showmodal calling). > > I guess I know I should not indirectly block OnDataAvailable event handler > by calling a showmodal because of show it works (creates a new message loop > and things can get messy), but this works just fine without the USE_SSL > define, so, I would like to understand why this happens. > > I could just disable USE_SSL for now, but I know I will soon need this is > our future release and I just want to understand why this socket behavior > changed and what should be the "correct" way of working with it > > Thanks > > Eric > -- 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
[twsocket] Compiling with SSL active changes socket behavior
Hi I recently came across an issue with our software after updating to ICS 8.26 We previously used ICS 8.06 and its default compiling directives did not add SSL support, but 8.26 by default activates SSL and makes TWSocket class to be derived from SSL socket I don't know if the problem is related to the SSL socket derivation but probably yes since deactivating SSL will make socket behave like before, which makes me think that could be a bug because socket behavior should not change because I activated SSL (even though I don't use it now, our project will require it later) So, basically the issue is in a message loop processing I guess In our CLIENT application there is a code that opens a form using SHOWMODAL when it receives a message from the server (Client is connected to server using our own protocol). As you probably know, SHOWMODAL will create a windows message loop so application can keep processing windows messsages. The problem is that apparently when compiling with SSL, when I call a showmodal from my protocol parser (that is called from OnDataAvailable) basically making showmodal being indirectly called from within the event handler of socket OnDataAvailable, it will not process any more socket messages while my form is open, although the application keeps processing all other windows messages it looks like any socket message (at least data rcv messages) are no longer being processed and my socket gets "hang" while form called with SHOWMODAL is open. This behavior occurs only when activating SSL, but if I deactivate SLL support it will work just fine, and while my form is open with showmodal, the socket still keeps processing new messages (from within the message loop created by showmodal calling). I guess I know I should not indirectly block OnDataAvailable event handler by calling a showmodal because of show it works (creates a new message loop and things can get messy), but this works just fine without the USE_SSL define, so, I would like to understand why this happens. I could just disable USE_SSL for now, but I know I will soon need this is our future release and I just want to understand why this socket behavior changed and what should be the "correct" way of working with it Thanks Eric -- 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
Re: [twsocket] Check Remote Port
Although I didn't want to use a component at designtime I used your advice and seems to work great! Thanks! -Original Message- From: TWSocket [mailto:twsocket-boun...@lists.elists.org] On Behalf Of Dod Sent: Thursday, July 21, 2016 10:42 PM To: ICS support mailingSubject: Re: [twsocket] Check Remote Port Hello, Why don't you use events ? ICS is so good event oriented. regards. ccg> Hello, ccg>Is there any easier way to check if a port is open on a remote ccg> server at runtime ? ccg> var ccg>SocketError: Integer; ccg> procedure TForm1.SessionConnected(Sender: TObject; ErrCode: Word); ccg> begin ccg>SocketError := ErrCode; ccg> end; ccg> procedure TForm1.Button1Click(Sender: TObject); var ccg>WSocket: TWSocket; ccg>Loop: Integer; ccg> begin ccg>WSocket := twsocket.create(nil); ccg>WSocket.OnSessionConnected := SessionConnected; ccg>WSocket.Connect; ccg>Loop := 0; ccg>while Loop < 1000 do ccg>begin ccg> Application.ProcessMessages; ccg> Sleep(10); ccg> Inc(Loop, 10); ccg>end; ccg>Caption := IntToStr(SocketError); // WSocket.LastError = 0 ??? ccg>FreeAndNil(WSocket); ccg> end; ccg> Thank you !!! mailto:do...@yahoo.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 -- 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
[twsocket] Post a file from C++ program to PHP server
Hi, What is the component most adapted to upload a .xml file to a PHP server folder with the POST method? Is there an example somewhere ? Thank you for your help. -- 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