[REBOL] Re: Problem: Talking from Rebol to Rebol via socket
From: petr:krenzelok:seznam:cz at: 23-Feb-2009 11:50
Robert M. Münch napsal(a):
> Am 22.02.2009, 15:40 Uhr, schrieb Petr Krenzelok
>>> Is there a way that I can WAIT to "read a message" or "send a message"?
>>> I'm missing a way to control/react on the communication direction flow.
> Hi, (why are my lines broken with this = char? Is it again a encoding
> problem from Opera?)
I can see your replies just OK.
>> yes, there is. In async mode, you are responsible for "waiting for
>> signal" - you have to do handshaking yourself.
> No problem, is there an example? Do I get signals like "ready to send",
> "data can be read"?
Ah, I meant nothing like that, just simple usage of wait, read-outs and
sending of data. But maybe some gurus here know more about internal TCP
port states (flags). Generally imo there should be absolutly no problem
in using both directions, as TCP communication uses TCP buffers (64KB on
recent systems), so REBOL should be fast enough to read data out from
the ports ...
>> As I said in my previous
>> email, be carefull, as you will run out from your data :-)
> That's normal TCP behaviour. On the C-level I can loop and check
> read/write Status, read partial things etc. The problem I have is, that I
> don't know how Rebol handles these situations nor how I'm supposed to do
I might try to adapt my example to some simple usage case scenario. E.g.
server on one side, 10 clients (10 ports) on other side, reading random
.r files in directory, sending them forth and back, asynchronously, but
I can see sqlab posted some example already.
There are some docs on the net (I found even one describing
open/direc/async from some alpha 2.5.5 Core, but that was later
deprecated), you might look along the lines of Romano's atcp://
protocol, and IIRC Gabriele and guys did something for the Network
Detective project? (
>> So, look into your server. You wait for first connection. Good. Then you
>> get your
>> connection, enter forever loop, but you don't wait for the other side!
> Ok, how do I wait for the other side? Is just adding a WAIT CONNECTION
I think so ...
> So, next round :-) I'll let you know. If someone has more information or
> an exmaple, please let me know.
It would be good, if we could move to R3 for such stuff, but we will
have to wait few more months :-)