Server Socket是不需要绑定IP的,对本机任何一个IP的访问都会激活ServerSocket,
并非"TServerSocket控件只是去取缺省的IP",
此时Socket参数的LocalAddress可以得知本机是哪一个IP被绑定.
例如:修改 Delphi 的Chat Demo,可以这样测试:
procedure TChatForm.ServerSocketAccept(Sender: TObject;
Socket: TCustomWinSocket);
begin
IsServer := True;
Statusbar1.Panels[0].Text := 'Connected to: ' + Socket.RemoteAddress+' by '+Socket.LocalAddress;
end;