Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Tcl/Tk on HP iPAQ socket problem

Status
Not open for further replies.

DrA10101

Programmer
Jun 10, 2003
8
US
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
}
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top