I'm using Tcl/Tk on an HP iPAQ on WinCE. When I get a read event, I can read the data from the socket OK, in fact, I can read multiple messages from the socket OK. However, when there is no data available from the socket, I get the following error:
tcl: select: 10022
Any ideas on a work-around?
I have included the read event handler code at the bottom of this message.
Thanks in advance.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Here's my read event handler:
# Procedure called whenever input arrives on a connection.
proc ReadHandler {f} {
global Gsock
# Delete the handler if the input was exhausted.
if {[eof $f]} {
fileevent $f readable {}
.c configure -text "EOF"
close $f
return
}
if {[catch {gets $f script}]} {
fileevent $f readable {}
.c configure -text "Catch1"
close $f
return
}
# Read and handle the incoming information. Here just log to stdout.
eval $script
}
tcl: select: 10022
Any ideas on a work-around?
I have included the read event handler code at the bottom of this message.
Thanks in advance.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Here's my read event handler:
# Procedure called whenever input arrives on a connection.
proc ReadHandler {f} {
global Gsock
# Delete the handler if the input was exhausted.
if {[eof $f]} {
fileevent $f readable {}
.c configure -text "EOF"
close $f
return
}
if {[catch {gets $f script}]} {
fileevent $f readable {}
.c configure -text "Catch1"
close $f
return
}
# Read and handle the incoming information. Here just log to stdout.
eval $script
}