TsgcWebSocketFirewall › Methods › IsBanned
Returns True when the given IP address is currently banned, taking into account both manual and automatic bans and their remaining duration.
function IsBanned(const aIP: string): Boolean;
| Name | Type | Description |
|---|---|---|
aIP | const string | IPv4 or IPv6 address to check against the ban list. |
True if the IP is currently banned; False otherwise. Expired timed bans are treated as not banned and evicted lazily on the next check. (Boolean)
IsBanned is cheap and thread-safe, so it can be called from custom event handlers to short-circuit application logic before further processing. It does not consult the Blacklist or GeoIP lists; those are evaluated by IsConnectionAllowed. Use IsBanned specifically to answer "is this IP currently under an active ban?".
if sgcWebSocketFirewall1.IsBanned(Connection.IP) then
Log('rejected banned IP: ' + Connection.IP);