As it says in the HELP file: This command is used to create file event handlers. A file event handler is a binding between a channel and a script, such that the script is evaluated whenever the channel becomes readable or writable. File event handlers are most commonly used to allow data to be received from another process on an event-driven basis, so that the receiver can continue to interact with the user while waiting for the data to arrive. If an application invokes gets or read on a blocking channel when there is no input data available, the process will block; until the input data arrives, it will not be able to service other events, so it will appear to the user to ``freeze up''. With fileevent, the process can tell when data is present and only invoke gets or read when they won't block.
So, you would use "fileevent" to, say, bind "read" or "gets" to a socket so that when data is presented, it gets attention, without tying up the script waiting for data. Bob Rashkin
rrashkin@csc.com
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.