0
這裏是我的代碼...如何讓德爾福XE2印10插槽服務器等主機名
procedure TMainForm.tsConnect(AContext: TIdContext);
var
s, INstr, adr:string;
port: Integer;
begin
with TMyContext(AContext) do
begin
Con := Now;
if (Connection.Socket <> nil) then
IP :=Connection.Socket.Binding.PeerIP;
port:=Connection.Socket.Binding.PeerPort;
s:=IntToStr(Connection.Socket.Binding.PeerPort);
TIdStack.IncUsage();
try
adr:= GStack.HostName;
finally
TIdStack.DecUsage;
end;
INstr := Connection.IOHandler.ReadLn;
Nick := INstr;
if Nick <> '' then
begin
memo1.Lines.Add('Opened <'+Nick + '> '+adr+' '+IP+':'+s+' '+DAteTimeToStr(now));
//SendNicks;
end else
begin
Connection.IOHandler.WriteLn('No Nick provided! Goodbye.');
Connection.Disconnect;
end;
end;
end;
GStack.HostName給我的服務器,如何讓客戶端主機名的名稱?