Hi,
When creating program to port forwarding over SSH, I found that the
CanRead function of TCPBlockSocket return always false. This was already
discussed on this forum in 2013 but what was the solution is not clear
to me. At that time Synapse version 3.9 was used.
I use FPC (CodeTyphon) with Synapse 4.0. I have tried simple echo server
demo from Synapse and I have the same issue that it not work. In
attachment is the source code. What I'm doing wrong?
procedure TTCPEchoDaemon.Execute;
var
ClientSock:TSocket;
begin
with sock do
begin
CreateSocket;
setLinger(true,10000);
bind('0.0.0.0','8008');
listen;
repeat
if terminated then break;
if canread(1000) then {this is all the time false in my case}
begin
Synchronize(@InfoCanRead);
ClientSock:=accept;
if lastError=0 then TTCPEchoThrd.create(ClientSock);
end else Synchronize(@InfoCanNotRead);
until false;
end;
end;
Thanks for help.
With best regards
Premek
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
synalist-public mailing list
synalist-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/synalist-public