Newsgroups : Borland : borland.public.delphi.internet.winsock : 2006 Jan : Re: TIdTCPServer listening all IP at port 1080. How to ?
| Subject: | Re: TIdTCPServer listening all IP at port 1080. How to ? |
| Posted by: | "Remy Lebeau (TeamB)" (no.spam@no.spam.com) |
| Date: | Thu, 26 Jan 2006 10:51:23 |
"SD" <nospawm@please.it> wrote in message
news:43d894a2@newsgroups.borland.com...
> Binding.IP := '192.168.0.21';
Setting the IP to an empty string tells the Binding to listen on all
available IPs:
Binding.IP := '';
> Binding.Port := '1080';
The Port property is an Integer, not a String:
Binding.Port := 1080;
> procedure MyConnect;
> var
> Binding: TIdSocketHandle;
> begin
> TCPServer.Bindings.Clear;
> TCPServer.DefaultPort := '1080';
> TCPServer.Active := True;
> end;
That will work fine, except that you left the now-unused variable in the
code, and the DefaultPort property is an Integer, not a String:.
procedure MyConnect;
begin
TCPServer.Bindings.Clear;
TCPServer.DefaultPort := 1080;
TCPServer.Active := True;
end;
When the server is activated, if the Bindings is empty than 1 Binding with a
blank IP is automatically added to the Bindings. The Defaultort value is
always assigned automatically when adding new items to the Bindings.
Gambit