Hi,
I got 3949 messages on 127.0.0.1, Windows NT 4.0, REBOL/View beta.
I think there can be a problem with opening and closing sockets too
fast.
--
Michal Kracik
[EMAIL PROTECTED] wrote:
>
> I'm making a little game in rebol (internet scrabble, currently in Swedish
> but could of course easily be translated if somebody is interested :) that
> requires two rebol scripts to message each others.
>
> Easy in theory. In practice, they close connection after a number of
> messages. I have no idea why. :(
>
> Here's some testing code. If I run this twice and enter 127.0.0.1
> (connecting to myself) it sends a total of 121 messages, and then one of
> the scripts refuse to accept a connection. I sent it to someone else, there
> it made 117 messages or so. But always the same number on the same system,
> it seems. I can't really explain this. What am I doing wrong?
>
> REBOL
> [Title: "netmsgtest"
> Date: 2000-04-17
> Author: "Johan Rönnblom"
> Purpose: {try to get two rebolscripts to message each other}]
>
> connect: func []
> [either error? try [client: open to-url rejoin ["tcp://" otherurl ":8000"]]
> [clienturl: to-url rejoin ["tcp://" otherurl ":8001"]
> server: open tcp://:8000
> mode: "server"
> running: receive]
> [insert client mold "connected"
> close client
> clienturl: to-url rejoin ["tcp://" otherurl ":8000"]
> server: open tcp://:8001
> mode: "client"]]
>
> transmit: func [msg]
> [if error? try [client: open clienturl]
> [print "Connection closed." close server quit]
> insert client mold msg
> close client]
>
> receive: func []
> [inmsg: do copy first server
> if inmsg = "exit" [close server quit]
> return inmsg]
>
> otherurl: ask "Enter remote url: "
>
> connect
> if mode = "client" [transmit "1"]
>
> forever
> [a: receive
> print a
> b: (to-integer a) + 1
> transmit b]
>
> --
> /Johan Rönnblom, Team Amiga
>
> Stop worrying so much about this. In the worst case we'll die.