[twsocket] how to reject same ip once already connected?

2012-04-14 Thread Simon
I been trying to make my server reject ip’s that are already connected to system
for i := 0 to (SocketServer.ClientCount -1) do begin
if (SocketServer.Client[i].GetPeerAddr = rSocket.GetPeerAddr) AND
(SocketServer.Client[i].Handle  rSocket.Handle) then
begin
// send message to client
Exit;
end;
end;
but don't seam to be able to get it working can sum one help please??
Thanks
--
To unsubscribe or change your settings for TWSocket mailing list
please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be

Re: [twsocket] how to reject same ip once already connected?

2012-04-14 Thread François Piette
 I been trying to make my server reject ip’s that are already connected to 
 system 
for i := 0 to (SocketServer.ClientCount -1) do begin 
  if (SocketServer.Client[i].GetPeerAddr = rSocket.GetPeerAddr) AND 
 (SocketServer.Client[i].Handle  rSocket.Handle) then begin 
// send message to client Exit; 
  end; 
 end;
 but don't seam to be able to get it working can sum one help please??

You should tell what is not working. Your code is partial, but at first looks 
OK.
You should be aware of proxies and NAT routers. If two computer are behind the 
same proxy or NAT router, they will have the same IP.


--
francois.pie...@overbyte.be
The author of the freeware multi-tier middleware MidWare
The author of the freeware Internet Component Suite (ICS)
http://www.overbyte.be



--
To unsubscribe or change your settings for TWSocket mailing list
please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be