Newsgroups : Borland : borland.public.delphi.internet.winsock : 2007 Mar : Re: How to set the listen port for the TIdTCPServer?
| Subject: | Re: How to set the listen port for the TIdTCPServer? |
| Posted by: | "Bo Berglund" (bo.berglu..@telia.com) |
| Date: | Sun, 25 Mar 2007 23:59:29 |
On Sun, 25 Mar 2007 21:50:23 +0200, Bo Berglund
<bo.berglund@telia.com> wrote:
>If I call SetStatusPort with the value 6001 and then call Openserver
>and then look in a command window with
>netstat -a -p tcp
>the result is that I can't see the port 6001 listed as a listening
>port. Why?
Don't know why it did not work the first time, but now it does...
I have another problem:
In the server OnExecute I have this code:
procedure TTool.srvCommandExecute(AThread: TIdPeerThread);
{Handler for client calls (calls are responses to commands)}
var
sRecData: string;
begin
sRecData := '';
while not AThread.Terminated and AThread.Connection.Connected do
begin
sRecData := AThread.Connection.ReadLn('</msg>', 2000);
if sRecData = '' then Continue;
AddCmdResponse(sRecData);
end;
end;
It seems like the server is stripping off the terminator (</msg> from
the returned data. Could this be changed so that I will receive the
complete string?