socket.Initialize("socket")
socket.Connect("127.0.0.1",1900,0)
astream.InitializePrefix(socket.InputStream,True,socket.OutputStream,"astream")
Private Sub astream_NewData (Buffer() As Byte)
Dim strAs String = BytesToString(Buffer,0,Buffer.Length,"UTF8")
Select Case str
Case "TMSG"
ToastMessageShow("TMSG",True)
End Select
' Log( str)
End Sub
procedure TForm1.IdTCPServer1Execute(AContext: TIdContext);
var
str: string;
begin
str := AContext.Connection.IOHandler.AllData();
if str <> EmptyStr then
begin
AContext.Connection.IOHandler.WriteLn('TMSG');
// do something with received string s
end;
end;