AltME: R3 Protocols

Messages

Andreas
Do you have the console print output you get somewhere gisted?
Rebolek
just a moment...
There's wait after "..Read 5 bytes"
Andreas
mhm
Rebolek
exactly...

GrahamC
don't know what's current but this line should be
https://github.com/rebolek/prot-redis/blob/master/prot-redis.r3#L250
tcp-port/spec/port-state: false or none
GrahamC
could be
tcp-port/awake: :awake-handler
so, your example could be
rp: open redis://192.168.2.11:10
write rp [ SET asynctest true ]
wait [ rp 3 ]
Rebolek
This doesn't help, it's still stuck in the wait loop, even with the change from ASYNC-HANDLER to AWAKE-HANDLER.

Rebolek
During redis:// test I crashed Rebol with "#9910: unspecific" error. I'll try to isolate the problem (but I guess it needs lots of reads and writes on TCP port). Has anybody seens this error before?
GrahamC
I've seen unspecific errors before but never recorded which ones

Rebolek
How can I read multiple TCP responses to one request? When I WAIT on port, I get first response and I can see with Wireshar other responses were sent also, but how do I access hem from Rebol?

Cyphre
Rebolek: I guess you need to implement your own awake handler for that.
(You might also check here for some tcp examples: http://www.rebol.net/wiki/Port_Examples#TCP_Network_Examples)
Rebolek
I'm writing my own awake handler for this, I just don't know how should to deal with his situation :)
his=this
Cyphre
hmm, not sure what is the problem...you should be able to handle that situation using the READ/WROTE events, no?
Rebolek
So should there be some loop in READ event?
something like until some-mysterious-condition [copy port/data] ?
Cyphre
I think first you need to know how much you read already, how much is left to read, if you are at the end of the response or not etc. and build logic around that in the awake handler. What protocol are you trying implement?
Also look at the examples...I don't remeber it from my head directly but you can either read or write on the port from the READ event depending if you want to wait for more data or send something to the server etc. It all depends on the protocol definiton.

Last message posted 490 weeks ago.