Hi!

I am not sure, if it is really possible to write a (save working)
multisession server in rebol.

In order to program a real working multisession server (without
multithreading) you must be able to protect your server from beeing
blocked in the IO-Commands.
For reading this is possible, the only thing you have to do is to
only read, when there is something to read. -> Wait for the ports.

But for writing you must be able to check, whether there is someone
who still reads the datas you are sending, or who read the datas you sent
before. "Query" seems not to be the right command for this purpose.

--- example --- 

;open server-socket
server: open tcp://:1005

; client part (evil client, which opens a port but never reads)
open tcp://:1005

; get connection
conn: first server

a: 0
forever [
  ; server loop (without multisession in this example)
  print a: a + 1
  ; and write some data
  ; ****
  write-io conn "* example *" 1024
]

--- end ---

So I need something to fill in the "; ****" line to prevent my server to
block. Is there a command for checking this?

Greetings,
Frank

Reply via email to