instead of 'eq "quit"' as it lets Quit and QUIT work, along w/ " quit " (note worthless whitespace) for those non-typists out there.if (/^\s*quit\s*$/i ) {
Yes, the \s*'s help; it won't quit on "I quit" that way. YMMV
Not sure why you open|close OUT each time, if its a appending log file, but I've seen (on Solaris, for instance) that my output doesn't get flushed properly if the close isn't executed (e.g. you have Ctrl-C to kill the server because 'quit' isn't working) and I get zero byte log files. Move them outside the accept loop and add a 'marker' print stmt, that puts the date and the client IP into the log file.
You may want to look at the cookbook/Camel and add a SIG handler that'll close OUT for INT/HUPs etc. If you can make sense of that, your socket programming knowledge will have gone forward another level.
a
In reply to Re: File I/O while using Sockets?
by a
in thread File I/O while using Sockets?
by jgallagher
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |