Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

Working with nonblocking sockets
Hi,

I've been trying and trying but can't get things working like i want to.
I'm trying to get my script connected to a FTP server using a
nonblocking and nonbuffered socket. At the moment I use a while
statement to fetch the data from the socket as it comes in. This works
just fine but the problem is that my script simply comes to a dead end
when the server stops sending data. I need some kind of timer which
'sees' that the server does not send any data and then aborts the while
statement.

while { ![eof $site(control_socket)] } {

if { [gets $site(control_socket) buf] < 0 } {
continue
}
puts $buf
}

My question is; how can I tell the while statement to stop if the server
does not send any data? (e.g. [gets $site(control_socket) buf] gives
me -1 for more than 100 milliseconds in a row)

Thank you for you help,

-Michiel

Report this thread to moderator Post Follow-up to this message
Old Post
Michiel
07-29-04 02:08 AM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

Tcl archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 04:27 PM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.