Difference between revisions of "Sockaccept"

From Scriptwiki
Jump to: navigation, search
m (Else statement in examples)
m
 
Line 13: Line 13:
  
 
[[Category:Socket]]
 
[[Category:Socket]]
 +
[[Category:Commands]]

Latest revision as of 19:24, 30 January 2011

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 }
}