JohnF 1 Posted 11 hours ago Hi Just started using ICS, I have a client that is talking to a TCP server. The GUI version works fine, the console version is not passing the SSL OndataAvailable is used for returning the data OnChangeState and Onhandshake are there for testing only On the console app; {$DEFINE NOFORMS} I have read that for consoles you need to have a message pump, how ever I'm not exactly sure where to plug it in. mySocket.OnMessagePump looks to be the obvious choice, and exactly which message calls are required. at the moment everything is running in the one main thread, however I might have to move it to its own thread later, A small example would be fab. Cheers FSslContext:= TSslContext.Create(Nil); FtcpSocket:= TSslWSocket.Create(Nil); tcpSocket.Name := 'icsReplayTcp'; tcpSocket.OnDataAvailable := SocketDataAvailable; tcpSocket.OnChangeState := SocketChangeState; tcpSocket.OnSslHandshakeDone := SocketSslHandshakeDone; tcpSocket.OnMessagePump := MyMessagePump; tcpSocket.Port := '1234'; tcpSocket.Addr := 'mytcpsoctet.com'; tcpSocket.SslContext := SslContext; tcpSocket.SslEnable := True; tcpSocket.Proto := 'tcp'; tcpSocket.SslContext.SslCAFile := 'CA.pem'; tcpSocket.SslContext.SslCertFile := 'DEMO3.pem'; TcpSocket.Connect; ..... procedure TICSReplay.MyMessagePump(Sender: TObject); begin tcpSocket.MessageLoop; end; Share this post Link to post
FPiette 390 Posted 8 hours ago Have a look at the sample OverbyteIcsConHttp.dpr in ICS distribution. Share this post Link to post