I met strange problem trying use simple code
from win32 application in windows service.
The code is:

********************

  FSocket.SSL.CertificateFile := 'cert2.pem';
  FSocket.SSL.PrivateKeyFile  := 'key2.pem';
  FSocket.Connect(DestHost,DestPort);
  FSocket.SSLDoConnect();
  FSocket.SendString('i'+CRLF);


  counter := 0;
  repeat
    Inc(Counter);
    Application.ProcessMessages;
    txt_buf := FSocket.RecvTerminated(100,CRLF);
    if txt_buf <>''
      then
        begin
          Counter := 0;
          ConnectionRichEdit.Lines.Add(txt_buf);
        end;
     if Counter = 600
       then
         ShowMessage('No incomming messages - one minute');
  until (Counter = 600);

  ShowMessage('Closing connection');

  FSocket.SSLDoShutdown;
  FSocket.CloseSocket;

********************

It's very simple so it works perfect.


But this code pasted into windows service doesn't work.
>From the server side it looks good, there is connection 
and server sends messages, but FSocket.RecvTerminated 
always returns nul.

I tried to call it in service application from Timer.OnTimer
function and from thread. Always the same result:
only connection is established properly, the rest doesn't works.

tcpdump shows, that there aren't ackowledges for frames
sent by the server.

Any suggestions?

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
synalist-public mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/synalist-public

Reply via email to