From WikiChip
Difference between revisions of "mirc/on events/on socklisten"
< mirc‎ | on events

(Created page with "The '''ON SOCKLISTEN''' event triggers when a connection is made on a listening socket created with {{mIRC|/socklisten}} == Synopsis == <pre>ON <level>:SOCKLISTEN:<matchtext>...")
 
Line 10: Line 10:
 
== Accepting a connection ==
 
== Accepting a connection ==
  
Note: By design, you cannot prevent a socket from being accepted, as in, Windows accept the connection even before mIRC.
+
'''Note''': By design, you cannot prevent a socket from being accepted, as in, Windows accept the connection even before mIRC.
  
 
You can use /sockaccept <newsocket> to accept a socket, mIRC create the new socket.
 
You can use /sockaccept <newsocket> to accept a socket, mIRC create the new socket.
 +
 +
'''Note''': If a new connection occurs on a socket but there is no on socklisten event matching that socket, the connection is rejected.
 +
  
 
== Examples ==
 
== Examples ==
<
+
 
 +
<source langu="mIRC">
 +
on *:socklisten:name:{
 +
sockaccept myprefix $+ $ticks
 +
}
 +
</source>
 +
 
 
== Compatibility ==
 
== Compatibility ==
 
{{mIRC compatibility|3.5}}
 
{{mIRC compatibility|3.5}}

Revision as of 20:44, 23 July 2014

The ON SOCKLISTEN event triggers when a connection is made on a listening socket created with /socklisten

Synopsis

ON <level>:SOCKLISTEN:<matchtext>:<commands>

Parameters

<matchtext>The name of the socket you want event to trigger on <commands>The commands to be performed when the event listener's criteria is met.

Accepting a connection

Note: By design, you cannot prevent a socket from being accepted, as in, Windows accept the connection even before mIRC.

You can use /sockaccept <newsocket> to accept a socket, mIRC create the new socket.

Note: If a new connection occurs on a socket but there is no on socklisten event matching that socket, the connection is rejected.


Examples

on *:socklisten:name:{
sockaccept myprefix $+ $ticks
}

Compatibility

Added: mIRC v3.5
Added on: 07 Aug 1995
Note: Unless otherwise stated, this was the date of original functionality.
Further enhancements may have been made in later versions.


See Also


/sockwrite /sockclose /sockread /sockaccept /sockpause $sock $sockbr /sockerr