Translated my chat from UDP to TCP and faced with the fact that data packets on the way to the server are glued together and vice versa from server to client. I could not compile the problem solving algorithm, I could not find any examples and information either.
procedure TForm1.ServerSocket1ClientRead(Sender: TObject; Socket: TCustomWinSocket); Var MemoryBuffer: string; i, p: integer; MemoryChange: string; login, password, UserSender, UserClientMessage, TextMessage, lastUserConnect: string; NewUser: boolean; begin MemoryBuffer:= Socket.ReceiveText; if Copy(MemoryBuffer,1,9) = '[Request]' then//ΠΏΡΠΎΠ²Π΅ΡΠΊΠ° Π½Π° ΠΊΠΎΠΌΠ°Π½Π΄Ρ Π² ΠΏΡΠΈΡΠ΅Π΄ΡΠΈΡ
Π΄Π°Π½Π½ΡΡ
begin ...//ΠΠ±ΡΠ°Π±ΠΎΡΠΊΠ° ΠΏΠΎΠ»ΡΡΠ΅Π½Π½ΡΡ
Π΄Π°Π½Π½ΡΡ
(ΠΊΠ°ΠΊ ΠΊΠ»ΠΈΠ΅Π½Ρ, ΡΠ°ΠΊ ΠΈ ΡΠ΅ΡΠ²Π΅Ρ ΠΏΠΎ ΡΠ°ΠΊΠΎΠΌΡ ΠΏΡΠΈΠ½ΡΠΈΠΏΡ) end;