question about sockets
dsc at swcp.com
Mon Oct 28 10:15:01 EST 2002
On Monday, October 28, 2002, at 03:21 AM, Björnke von Gierke wrote:
> I am trying to do some connection stuff using the open socket, write to
> socket, and accept socket in their datagram form.
> I run a by connecting to my own Jaguar mac, but I only can get one message
> through and I really don't know what's wrong...
There is a bug in Revolution 1.1.1 concerning datagrams. Also there are
features in Revolution 2.0 that will require more work.
This is based on 10.1.x and I assume it will work the same on Jaguar.
In OS X for Revolution 1.1.1 you get a false message when you do the accept
and you get only one more.
The workaround is two parts: You need to throw away the false message and
reopen the accept. The false message is always empty, so if yours is never
empty, you can test on that in deciding to throw away a datagram. After
you get the real message you need to close the accept and open it again.
To be ready for Revolution 2.0, you should also "close socket" the
connectionID you get with the callback and ignore the error. (Or test on
version. Or make a note to yourself.)
On Revolution 2.0 you will be able to send datagrams back and receive
datagrams sent back on that same "connection" identified by the
connectionID in the callback. To support this a "connection" is opened for
you just before the callback.
I have heard a rumor of another potential problem that might show up in 2.
0. A Revolutionary made several standalones using the new engine and ran
them on the same computer. One sent datagrams to the others. Sometimes
one of the others would not receive the datagram until its window was
clicked. (I may have added my own confusion to this rumor.) There have
been lots of engine changes recently, so this may have been taken care of.
Other than these OS X problems which will go away soon, the use of
datagrams looks very good on Revolution.
More information about the Use-livecode