Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

[REBOL] Re: Problem: Talking from Rebol to Rebol via socket

From: robert::muench::robertmuench::de at: 22-Feb-2009 14:26

-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA384 Am 22.02.2009, 11:51 Uhr, schrieb Petr Krenzelok <petr.krenzelok-seznam.cz>:
> Bug here - it should be - insert c-client. You can't insert into > listening socket, just to derived connection channel.
Hi, ok, I got this now :-).
> But - your script > will not even get here. You use blocking synchronous communication. In > this mode, it seems to me, that you stay stuck in the 'copy section, > until you close the connection on the other side.
Good point and is something I observed too. But it's not documented when using synchronous mode how to get things transferred. So the listening part hangs until the other side closes the socket, than the so far received content is returned. This means, that using synchronous mode isn't feasible to send messages back and forth over the same socket.
> I don't use any other mode than open/direct/no-wait .... you have to be > just carefull here - you need to "wait", or the program runs out ...
Ok, thanks. While scanning some other Rebol scripts I saw this sometimes. But again, the docs are a bit simple on all this. I expect this to be the same problem in my other post. Because Rebol uses the synchronous mode, I just can't swap directions. I will look into this /direct/no-wait stuff.
> In your while look, when reading out the data, you can receive empty result > = no data, or none = other side closed the connection ....
Ok, that maps to socket behavior on the C level. Makes sense.
> If you want better multiplexing, it would be probably better to build wait block, > along with time interval, so you either get your processing by an event > received from network, or time timeout ....
Yes, whereas my goal is to just send messages back and forth using the same socket/connection.
> Here's small examples: > ...
Thanks, this brings me a step forward. - -- Robert M. M=FCnch Management and IT freelancer http://www.robertmuench.de -----BEGIN PGP SIGNATURE----- Version: PGP Desktop 9.9.1 (Build 287) Charset: iso-8859-15 wsBVAwUBSaFSjHSQa/BbHGLwAQnaHAgAnGm/ycSuJ7zo41EW7s7EiX7mtiIYYsC1 8kk+yN2lymK7S3n7Fdtp2gWL9Xxe3filMxrmlkej3TeiM7gDZBcySxitb2GW73XS 83aS6QWExqDnmqjjQac7un3cRB+xLps+Ae8nPhTEtmR0t/bYPVSzTL5tHzie0PcL Bk86bfJ1TBs2Bp6lc7tnwVaSPObVOoZK8MpcphZC3KXJJBe6TcHw/FrS2DEB4xgR uR4cewn+WDO9UnTB/mpm3OwZfA+naVW2/5b382s6QMJlJHHop12iHGzmuApQWYm9 OOaJg7GsnLr7fyORVGnNZbdGVsb9suVpoqAN3P5NtYOh+vdW2lu0Iw== =q1Ed -----END PGP SIGNATURE-----