> Please test this code 1:1 and tell me where the problem is with the receive. I've implemented the function in the receive thread exactly as you described. However, the server only calls FParent.LastContext.Connection.IOHandler.WriteDire ct(Data.Data); five times (I know because the client's buffer is full), and the client receives nothing.
Yes this one and i tested 1:1 and well... i have to few lines due to inline varibales !! my
IDE doesn't support them and i don't have one super duper likes yours.
The result it is
not working, server send the the client still not reading ! as it is not reading at all, and my diagnosis is still standing and right the server send and stop sending when the client is not receiving.
Now, what is the problem ?
The problem is you still missing the use of simple copy and paste, compare your pasted client and see for your self, you missed the critical protection against performing blocking recv on no fully connected socket !
So once you change this line
if Assigned(FParent) and Assigned(FParent.FParentClient) then //
,
To this line
if Assigned(FParent) and Assigned(FParent.FParentClient) and FParent.FParentClient.Connected then //
,
It will work like charm !
Performing recv will block forever on non ready socket (also will not receive anything), keep that in mind and you will left with 99 problem to solve.