Sockaccept

From Scriptwiki
Revision as of 19:24, 30 January 2011 by Vliedel (talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

The sockaccept command assigns a TCP socket name to an incoming connection in an On socklisten event

sockaccept <name>

Examples

on *:SOCKLISTEN:MyWebServer: {
 sockaccept Check
 if ($sock(check).ip == allowedIP) {
   Sockrename Check MyWebServerConnection $+ $ticks
 }
 else { sockclose Check }
}