socket 问题 ( 积分: 26 )

  • 主题发起人 主题发起人 ztc78
  • 开始时间 开始时间
Z

ztc78

Unregistered / Unconfirmed
GUEST, unregistred user!
procedure Tf_main.ServerSocketSendInfoClientConnect(Sender: TObject;
Socket: TCustomWinSocket);
var
I: Integer;
begin
for I := ServerSocketSendInfo.Socket.ActiveConnections - 2 downto 0 do
begin
if ServerSocketSendInfo.Socket.Connections.RemoteAddress = Socket.RemoteAddress then
begin
ServerSocketSendInfo.Socket.Connections.Close;
end;
end;
end;
其中的
ServerSocketSendInfo.Socket.Connections.RemoteAddress = Socket.RemoteAddress
等号右边的socket.remoteaddress代表那个地址啊?
 
procedure Tf_main.ServerSocketSendInfoClientConnect(Sender: TObject;
Socket: TCustomWinSocket);
var
I: Integer;
begin
for I := ServerSocketSendInfo.Socket.ActiveConnections - 2 downto 0 do
begin
if ServerSocketSendInfo.Socket.Connections.RemoteAddress = Socket.RemoteAddress then
begin
ServerSocketSendInfo.Socket.Connections.Close;
end;
end;
end;
其中的
ServerSocketSendInfo.Socket.Connections.RemoteAddress = Socket.RemoteAddress
等号右边的socket.remoteaddress代表那个地址啊?
 
Socket.RemoteAddress 是当前连接的客户端的IP地址
 
目标地址,如果等于的话就开始其他操作...
 

Similar threads

S
回复
0
查看
896
SUNSTONE的Delphi笔记
S
S
回复
0
查看
873
SUNSTONE的Delphi笔记
S
I
回复
0
查看
509
import
I
后退
顶部