Rebol Talk Forum  |  Getting Started  |  Newbie Help  |  Topic: more port problems
Pages: [1] Print
Author Topic: more port problems  (Read 406 times)
fhein
Newbie
*
Offline Offline

Posts: 47


View Profile
more port problems
« on: June 01, 2005, 11:28:46 PM »

It seems like wait (for a port) generates an event when the client closes the connection due to a timeout. This causes my program to launch the code "first port" which generates the following error message:

** Script Error: Out of range or past end
** Where: switch
** Near: either debug: temp: first port

How can I test the port if there's data to read?

And another question, if I'm not ready to handle more data yet, can I just stall the port by not reading from it? What happens when the buffer fills up?

----

Just thought of something.. If I use write-io to send some stuff to a no-wait port, will this cause my program to pause execution until it's transfered or is it asynchronous?

----

The problems are just building up.. Can't I write to a port while there's data on it waiting to be read?
« Last Edit: June 01, 2005, 11:51:37 PM by fhein » Logged
Gabriele
Full Member
***
Offline Offline

Posts: 182


View Profile WWW
more port problems
« Reply #1 on: June 02, 2005, 04:06:28 AM »

1) Is that a /LINES port? You can use PICK instead of FIRST, it will return NONE instead of giving you an error. Alternatively, you can wrap the call to FIRST into ATTEMPT so that you get a NONE in case of error. You don't need to read the data immediately, but if you don't read from it the port will remain in awaken state.

2) WRITE-IO (as all other functions) is synchronous, unless you use async-modes.

3) You can write to a port if there is data to read.
Logged
Pages: [1] Print 
Rebol Talk Forum  |  Getting Started  |  Newbie Help  |  Topic: more port problems
Jump to:  

  
Quick Search...

Advanced search
  
Welcome, Guest. Please login or register.
Did you miss your activation email?
October 12, 2008, 12:23:51 AM
Username: Password: Session Length:
  

News: 01-09-08

Alpha version of REBOL 3 has been released!


  
2251 Posts in 589 Topics by 2420 Members
Latest Member: pharmacytovvv

  Rebol Talk Forum | Powered by SMF 1.0.9.
© 2001-2005, Lewis Media. All Rights Reserved.

RT design by Defiant Pc