Re: sockets post to url

2010-09-02 Thread Monte Goulding
ah... scratch that, nothing to see here

On 02/09/2010, at 5:14 PM, Monte Goulding wrote:

 Hi
 
 I have an app that accepts connections on a socket to sync to an iOS version. 
 
 post to url works before and after:
 accept connections on port lPort with message newConnection -- lPort is 
 8009 as default but user settable
 until the connections start coming in from the server. To avoid socket 
 timeouts while the user does some licensing stuff the phone repeatedly asks 
 if it's ok to sync and the app either responds with an accept, reject or 
 pending message. While these connections are coming in post to url does not 
 return although it doesn't block the UI either so you can click the button 
 that sends the post again and then it returns immediately with error 
 Previous request not completed as result. The docs say url commands block 
 each other but no mention of other socket connections blocking them too. 
 
 When the connections stop coming in from the phone (no open sockets but still 
 listening) then post works again but not if you have tried to post to a url 
 while the connections are coming in in which case you still get the error in 
 the result. resetAll (libURLresetAll) does nothing for me.
 
 Is this a known bug?
 Is there a workaround?
 
 Cheers
 
 Monte___
 use-revolution mailing list
 use-revolution@lists.runrev.com
 Please visit this url to subscribe, unsubscribe and manage your subscription 
 preferences:
 http://lists.runrev.com/mailman/listinfo/use-revolution

___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: sockets post to url

2010-09-02 Thread Andre Garzia
Monte,

can you detail how you solved this for future mail list search abilities!

:D

On Thu, Sep 2, 2010 at 4:27 AM, Monte Goulding
mo...@sweattechnologies.comwrote:

 ah... scratch that, nothing to see here

 On 02/09/2010, at 5:14 PM, Monte Goulding wrote:

  Hi
 
  I have an app that accepts connections on a socket to sync to an iOS
 version.
 
  post to url works before and after:
  accept connections on port lPort with message newConnection -- lPort is
 8009 as default but user settable
  until the connections start coming in from the server. To avoid socket
 timeouts while the user does some licensing stuff the phone repeatedly asks
 if it's ok to sync and the app either responds with an accept, reject or
 pending message. While these connections are coming in post to url does not
 return although it doesn't block the UI either so you can click the button
 that sends the post again and then it returns immediately with error
 Previous request not completed as result. The docs say url commands block
 each other but no mention of other socket connections blocking them too.
 
  When the connections stop coming in from the phone (no open sockets but
 still listening) then post works again but not if you have tried to post to
 a url while the connections are coming in in which case you still get the
 error in the result. resetAll (libURLresetAll) does nothing for me.
 
  Is this a known bug?
  Is there a workaround?
 
  Cheers
 
  Monte___
  use-revolution mailing list
  use-revolution@lists.runrev.com
  Please visit this url to subscribe, unsubscribe and manage your
 subscription preferences:
  http://lists.runrev.com/mailman/listinfo/use-revolution

 ___
 use-revolution mailing list
 use-revolution@lists.runrev.com
 Please visit this url to subscribe, unsubscribe and manage your
 subscription preferences:
 http://lists.runrev.com/mailman/listinfo/use-revolution




-- 
http://www.andregarzia.com All We Do Is Code.
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: sockets post to url

2010-09-02 Thread Monte Goulding
LOL, just a bug in my code mate. Was closing line 1 of the opensockets which 
was fine when the licensing stuff was happening in a separate process but not 
when I put it back in the main app ;-)

On 03/09/2010, at 12:45 AM, Andre Garzia wrote:

 Monte,
 
 can you detail how you solved this for future mail list search abilities!
 
 :D
 
 On Thu, Sep 2, 2010 at 4:27 AM, Monte Goulding
 mo...@sweattechnologies.comwrote:
 
 ah... scratch that, nothing to see here
 
 On 02/09/2010, at 5:14 PM, Monte Goulding wrote:
 
 Hi
 
 I have an app that accepts connections on a socket to sync to an iOS
 version.
 
 post to url works before and after:
 accept connections on port lPort with message newConnection -- lPort is
 8009 as default but user settable
 until the connections start coming in from the server. To avoid socket
 timeouts while the user does some licensing stuff the phone repeatedly asks
 if it's ok to sync and the app either responds with an accept, reject or
 pending message. While these connections are coming in post to url does not
 return although it doesn't block the UI either so you can click the button
 that sends the post again and then it returns immediately with error
 Previous request not completed as result. The docs say url commands block
 each other but no mention of other socket connections blocking them too.
 
 When the connections stop coming in from the phone (no open sockets but
 still listening) then post works again but not if you have tried to post to
 a url while the connections are coming in in which case you still get the
 error in the result. resetAll (libURLresetAll) does nothing for me.
 
 Is this a known bug?
 Is there a workaround?
 
 Cheers
 
 Monte___
 use-revolution mailing list
 use-revolution@lists.runrev.com
 Please visit this url to subscribe, unsubscribe and manage your
 subscription preferences:
 http://lists.runrev.com/mailman/listinfo/use-revolution
 
 ___
 use-revolution mailing list
 use-revolution@lists.runrev.com
 Please visit this url to subscribe, unsubscribe and manage your
 subscription preferences:
 http://lists.runrev.com/mailman/listinfo/use-revolution
 
 
 
 
 -- 
 http://www.andregarzia.com All We Do Is Code.
 ___
 use-revolution mailing list
 use-revolution@lists.runrev.com
 Please visit this url to subscribe, unsubscribe and manage your subscription 
 preferences:
 http://lists.runrev.com/mailman/listinfo/use-revolution

___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: sockets post to url

2010-09-02 Thread Andre Garzia
Once I built a web server in Rev... for a while, I tried testing it by
building a client also in Rev. Now, when everything is running at the same
time inside Rev IDE, things can get messy...



On Thu, Sep 2, 2010 at 7:03 PM, Monte Goulding
mo...@sweattechnologies.comwrote:

 LOL, just a bug in my code mate. Was closing line 1 of the opensockets
 which was fine when the licensing stuff was happening in a separate process
 but not when I put it back in the main app ;-)

 On 03/09/2010, at 12:45 AM, Andre Garzia wrote:

  Monte,
 
  can you detail how you solved this for future mail list search abilities!
 
  :D
 
  On Thu, Sep 2, 2010 at 4:27 AM, Monte Goulding
  mo...@sweattechnologies.comwrote:
 
  ah... scratch that, nothing to see here
 
  On 02/09/2010, at 5:14 PM, Monte Goulding wrote:
 
  Hi
 
  I have an app that accepts connections on a socket to sync to an iOS
  version.
 
  post to url works before and after:
  accept connections on port lPort with message newConnection -- lPort
 is
  8009 as default but user settable
  until the connections start coming in from the server. To avoid socket
  timeouts while the user does some licensing stuff the phone repeatedly
 asks
  if it's ok to sync and the app either responds with an accept, reject or
  pending message. While these connections are coming in post to url does
 not
  return although it doesn't block the UI either so you can click the
 button
  that sends the post again and then it returns immediately with error
  Previous request not completed as result. The docs say url commands
 block
  each other but no mention of other socket connections blocking them too.
 
  When the connections stop coming in from the phone (no open sockets but
  still listening) then post works again but not if you have tried to post
 to
  a url while the connections are coming in in which case you still get
 the
  error in the result. resetAll (libURLresetAll) does nothing for me.
 
  Is this a known bug?
  Is there a workaround?
 
  Cheers
 
  Monte___
  use-revolution mailing list
  use-revolution@lists.runrev.com
  Please visit this url to subscribe, unsubscribe and manage your
  subscription preferences:
  http://lists.runrev.com/mailman/listinfo/use-revolution
 
  ___
  use-revolution mailing list
  use-revolution@lists.runrev.com
  Please visit this url to subscribe, unsubscribe and manage your
  subscription preferences:
  http://lists.runrev.com/mailman/listinfo/use-revolution
 
 
 
 
  --
  http://www.andregarzia.com All We Do Is Code.
  ___
  use-revolution mailing list
  use-revolution@lists.runrev.com
  Please visit this url to subscribe, unsubscribe and manage your
 subscription preferences:
  http://lists.runrev.com/mailman/listinfo/use-revolution

 ___
 use-revolution mailing list
 use-revolution@lists.runrev.com
 Please visit this url to subscribe, unsubscribe and manage your
 subscription preferences:
 http://lists.runrev.com/mailman/listinfo/use-revolution




-- 
http://www.andregarzia.com All We Do Is Code.
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: Sockets

2010-05-06 Thread Bob Sneidar
Shouldn't you put it AFTER fld f1 if you are tracing it?

Bob


On May 5, 2010, at 3:19 PM, Hershel Fisch wrote:

 Hi, I checked it out,
 I did realize that there are 2 ports being used 1 form client to server and
 1 from server to client. Though I don't know how to make use of it in my
 case.
 Also I think there is a typo in tnhe example script (sSocket instead of
 pSocket) or something doesn't work properly.
 
 I did get some info from it.
 
 NOW, This what I wrote;
 
 on mouseUp
   put 192.168.1.199:4559 into pSocket
   open socket to pSocket
   read from socket pSocket until return
   put it into fld f1  -to trace results
 
   write USER admin  linefeed  PASS xx to socket pSocket
   read from socket pSocket until return
   put it into fld f2 of this stack
 
   write  /usr/local/sbin/hfaxd help  linefeed to socket pSocket
   read from socket pSocket until return
   put it into fld f3 of this stack   looks like it reenters the
 same command twice
   close socket pSocket
 Now if I repeat the second write twice then this is what I get...
 
 500 /USR/LOCAL/SBIN/HFAXD: Command not recognized.
 
 end mouseUp
 
 Any help would be highly appreciated.
 Thanks, Hershel
 
 
 
 On 4/29/10 3:24 PM, Hershel Fisch hersh...@syp2u4c.com wrote:
 
 Thanks, I'll check it out.
 Hershel
 
 
 On 4/28/10 9:04 AM, Trevor DeVore li...@mangomultimedia.com wrote:
 
 On Apr 27, 2010, at 4:23 PM, Hershel Fisch wrote:
 
 Hi, could any help me out with a full socket session ? Please!
 
 Perhaps this lesson will help:
 
 
 http://lessons.runrev.com/spaces/lessons/buckets/784/lessons/12924-How-to-com
 m
 unicate-with-other-applications-using-sockets
 
 
 
 ___
 use-revolution mailing list
 use-revolution@lists.runrev.com
 Please visit this url to subscribe, unsubscribe and manage your subscription
 preferences:
 http://lists.runrev.com/mailman/listinfo/use-revolution
 
 
 
 ___
 use-revolution mailing list
 use-revolution@lists.runrev.com
 Please visit this url to subscribe, unsubscribe and manage your subscription 
 preferences:
 http://lists.runrev.com/mailman/listinfo/use-revolution

___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: Sockets

2010-05-06 Thread Hershel Fisch



On 5/6/10 12:28 PM, Bob Sneidar b...@twft.com wrote:

 Shouldn't you put it AFTER fld f1 if you are tracing it?
That's the reason every read I put into another fld., and also to see what
read returns what. As I saw that the second write repeated the same as the
first.
 
 Bob
 
 
 On May 5, 2010, at 3:19 PM, Hershel Fisch wrote:
 
 Hi, I checked it out,
 I did realize that there are 2 ports being used 1 form client to server and
 1 from server to client. Though I don't know how to make use of it in my
 case.
 Also I think there is a typo in tnhe example script (sSocket instead of
 pSocket) or something doesn't work properly.
 
 I did get some info from it.
 
 NOW, This what I wrote;
 
 on mouseUp
   put 192.168.1.199:4559 into pSocket
   open socket to pSocket
   read from socket pSocket until return
   put it into fld f1  -to trace results
 
   write USER admin  linefeed  PASS xx to socket pSocket
   read from socket pSocket until return
   put it into fld f2 of this stack
 
   write  /usr/local/sbin/hfaxd help  linefeed to socket pSocket
   read from socket pSocket until return
   put it into fld f3 of this stack   looks like it reenters the
 same command twice
   close socket pSocket
 Now if I repeat the second write twice then this is what I get...
 
 500 /USR/LOCAL/SBIN/HFAXD: Command not recognized.
 
 end mouseUp
 
 Any help would be highly appreciated.
 Thanks, Hershel
 
 
 
 On 4/29/10 3:24 PM, Hershel Fisch hersh...@syp2u4c.com wrote:
 
 Thanks, I'll check it out.
 Hershel
 
 
 On 4/28/10 9:04 AM, Trevor DeVore li...@mangomultimedia.com wrote:
 
 On Apr 27, 2010, at 4:23 PM, Hershel Fisch wrote:
 
 Hi, could any help me out with a full socket session ? Please!
 
 Perhaps this lesson will help:
 
 
 http://lessons.runrev.com/spaces/lessons/buckets/784/lessons/12924-How-to-com
 
 m
 unicate-with-other-applications-using-sockets
 
 
 
 ___
 use-revolution mailing list
 use-revolution@lists.runrev.com
 Please visit this url to subscribe, unsubscribe and manage your subscription
 preferences:
 http://lists.runrev.com/mailman/listinfo/use-revolution
 
 
 
 ___
 use-revolution mailing list
 use-revolution@lists.runrev.com
 Please visit this url to subscribe, unsubscribe and manage your subscription
 preferences:
 http://lists.runrev.com/mailman/listinfo/use-revolution
 
 ___
 use-revolution mailing list
 use-revolution@lists.runrev.com
 Please visit this url to subscribe, unsubscribe and manage your subscription
 preferences:
 http://lists.runrev.com/mailman/listinfo/use-revolution



___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: Sockets

2010-05-05 Thread Hershel Fisch
Hi, I checked it out,
I did realize that there are 2 ports being used 1 form client to server and
1 from server to client. Though I don't know how to make use of it in my
case.
Also I think there is a typo in tnhe example script (sSocket instead of
pSocket) or something doesn't work properly.

I did get some info from it.

NOW, This what I wrote;

on mouseUp
   put 192.168.1.199:4559 into pSocket
   open socket to pSocket
   read from socket pSocket until return
   put it into fld f1  -to trace results
   
   write USER admin  linefeed  PASS xx to socket pSocket
   read from socket pSocket until return
   put it into fld f2 of this stack
  
   write  /usr/local/sbin/hfaxd help  linefeed to socket pSocket
   read from socket pSocket until return
   put it into fld f3 of this stack   looks like it reenters the
same command twice
   close socket pSocket
Now if I repeat the second write twice then this is what I get...

500 /USR/LOCAL/SBIN/HFAXD: Command not recognized.

end mouseUp

Any help would be highly appreciated.
Thanks, Hershel



On 4/29/10 3:24 PM, Hershel Fisch hersh...@syp2u4c.com wrote:

 Thanks, I'll check it out.
 Hershel
 
 
 On 4/28/10 9:04 AM, Trevor DeVore li...@mangomultimedia.com wrote:
 
 On Apr 27, 2010, at 4:23 PM, Hershel Fisch wrote:
 
 Hi, could any help me out with a full socket session ? Please!
 
 Perhaps this lesson will help:
 
 
http://lessons.runrev.com/spaces/lessons/buckets/784/lessons/12924-How-to-com
m
 unicate-with-other-applications-using-sockets
 
 
 
 ___
 use-revolution mailing list
 use-revolution@lists.runrev.com
 Please visit this url to subscribe, unsubscribe and manage your subscription
 preferences:
 http://lists.runrev.com/mailman/listinfo/use-revolution



___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: Sockets

2010-04-29 Thread Hershel Fisch
Thanks, I'll check it out.
Hershel


On 4/28/10 9:04 AM, Trevor DeVore li...@mangomultimedia.com wrote:

 On Apr 27, 2010, at 4:23 PM, Hershel Fisch wrote:
 
 Hi, could any help me out with a full socket session ? Please!
 
 Perhaps this lesson will help:
 
 http://lessons.runrev.com/spaces/lessons/buckets/784/lessons/12924-How-to-comm
 unicate-with-other-applications-using-sockets



___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: Sockets

2010-04-28 Thread Trevor DeVore

On Apr 27, 2010, at 4:23 PM, Hershel Fisch wrote:


Hi, could any help me out with a full socket session ? Please!


Perhaps this lesson will help:

http://lessons.runrev.com/spaces/lessons/buckets/784/lessons/12924-How-to-communicate-with-other-applications-using-sockets

--
Trevor DeVore
Blue Mango Learning Systems
ScreenSteps: http://www.screensteps.com
Releasable Revolution Resources for Developers: 
http://revolution.bluemangolearning.com
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: Sockets

2010-04-28 Thread Hershel Fisch
To communicate with  Hylafax (fax) server


On 4/27/10 7:19 PM, Shani shani.run...@gmail.com wrote:

 HI, 
 
 http://docs.runrev.com/Command/open-socket
 http://docs.runrev.com/Command/write-to-socket
 http://docs.runrev.com/Command/read-from-socket
 http://docs.runrev.com/Command/close-socket
 
 for what purpose you need socket session?
 
 Regards,
 SHANI
 
 -Original Message-
 From: use-revolution-boun...@lists.runrev.com
 [mailto:use-revolution-boun...@lists.runrev.com] On Behalf Of Sarah Reichelt
 Sent: Wednesday, April 28, 2010 12:59 AM
 To: How to use Revolution
 Subject: Re: Sockets
 
 On Wed, Apr 28, 2010 at 6:23 AM, Hershel Fisch hersh...@syp2u4c.com wrote:
 Hi, could any help me out with a full socket session ? Please!
 
 Check out either of my email libraries:
 http://www.troz.net/rev/stacks/POP_library_demo.rev
 http://www.troz.net/rev/stacks/SMTP_library_demo.rev
 
 They both use sockets to communicate to the relevant servers.
 
 Cheers,
 Sarah
 ___
 use-revolution mailing list
 use-revolution@lists.runrev.com
 Please visit this url to subscribe, unsubscribe and manage your subscription
 preferences:
 http://lists.runrev.com/mailman/listinfo/use-revolution
 
 ___
 use-revolution mailing list
 use-revolution@lists.runrev.com
 Please visit this url to subscribe, unsubscribe and manage your subscription
 preferences:
 http://lists.runrev.com/mailman/listinfo/use-revolution



___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: Sockets

2010-04-27 Thread Sarah Reichelt
On Wed, Apr 28, 2010 at 6:23 AM, Hershel Fisch hersh...@syp2u4c.com wrote:
 Hi, could any help me out with a full socket session ? Please!

Check out either of my email libraries:
http://www.troz.net/rev/stacks/POP_library_demo.rev
http://www.troz.net/rev/stacks/SMTP_library_demo.rev

They both use sockets to communicate to the relevant servers.

Cheers,
Sarah
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


RE: Sockets

2010-04-27 Thread Shani
HI, 

http://docs.runrev.com/Command/open-socket
http://docs.runrev.com/Command/write-to-socket
http://docs.runrev.com/Command/read-from-socket
http://docs.runrev.com/Command/close-socket

for what purpose you need socket session?

Regards,
SHANI

-Original Message-
From: use-revolution-boun...@lists.runrev.com
[mailto:use-revolution-boun...@lists.runrev.com] On Behalf Of Sarah Reichelt
Sent: Wednesday, April 28, 2010 12:59 AM
To: How to use Revolution
Subject: Re: Sockets

On Wed, Apr 28, 2010 at 6:23 AM, Hershel Fisch hersh...@syp2u4c.com wrote:
 Hi, could any help me out with a full socket session ? Please!

Check out either of my email libraries:
http://www.troz.net/rev/stacks/POP_library_demo.rev
http://www.troz.net/rev/stacks/SMTP_library_demo.rev

They both use sockets to communicate to the relevant servers.

Cheers,
Sarah
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution

___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: Sockets

2005-12-12 Thread Graham Samuel
This is just a quick 'thank you' to Alex Tweedly and Dave Cragg for  
their very educational mails. I will experiment shortly and get back  
to the list when (not if) I get into a muddle.


Graham


 
---

Graham Samuel / The Living Fossil Co. / UK and France

___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: Sockets

2005-12-12 Thread Jim Hurley
Like Graham, I too would like to thank Alex and Dave for their 
detailed discussion of sockets.


I tried Dave's small handler and it worked well, but only  once. I 
went into the script to insert a break point so that I could step 
through it to see how it works, but it wouldn't work a second time. 
Even after I took the break point out, it still wouldn't work.


Looks like it got all wore out after one use.

Jim
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: Sockets

2005-12-12 Thread Dave Cragg


On 13 Dec 2005, at 01:40, Jim Hurley wrote:

Like Graham, I too would like to thank Alex and Dave for their  
detailed discussion of sockets.


I tried Dave's small handler and it worked well, but only  once. I  
went into the script to insert a break point so that I could step  
through it to see how it works, but it wouldn't work a second time.  
Even after I took the break point out, it still wouldn't work.


Looks like it got all wore out after one use.


I hope not. People will want their money back. :-)

The server script appears to be still running here, but I'm  
connecting over an internal network, and so use a different IP  
address from the one in the script I posted.


You'll have noticed a complete lack of error checking in the script I  
posted, and also on the server script if you managed to retrieve it.  
Error checking is lesson 2. :-) Unfortunately, I have to go Christmas  
shopping shortly (I promised), so I can't do much right now. You  
could add a socketError handler to the script. The sample handler in  
the Rev docs (under socketError) should be fine.


Setting a breakpoint may not be so useful. I haven't tried this  
recently, but in the past I found it difficult (impossible) to use  
the debugger with asynchronous behavior like this. Instead, you might  
want to add lines to the script that record values to another field.


For example, add the following log handler

on logit pData
 put pData  return after field log
end logit

and then add log sttaements wherever you want to inspect something.  
For example:


on readLineOne pS
  logit readLineOne  pS ##DEBUG
  read from socket pS for one line with message readmore
end readLineOne

Cheers
Dave
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: Sockets

2005-12-11 Thread Björnke von Gierke


On Dec 11 2005, at 17:32, Jim Hurley wrote:


...
Searched the dictionary for socket and came up with the single 
Using URLs, uploading, and downloading, 18 pages (copied to Word) 
which don't  appear to contain the word socket.


Is there a secret RR society which is privy to this sort of thing? Can 
I join? Sock it to me.

...


Of course there is a secret Socket society! But it's easy to join:
Our required readings are:

Open Socket command
Close Socket command
Accept command

If these don't help you, then you need to ask either on the use list or 
in chatrev :)


socket society member
Björnke


--

official ChatRev page:
http://chatrev.bjoernke.com

Chat with other RunRev developers:
go stack URL http://homepage.mac.com/bvg/chatrev1.3.rev;

___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: Sockets

2005-12-11 Thread Mark Wieder
Björnke-

Sunday, December 11, 2005, 8:49:42 AM, you wrote:

 Of course there is a secret Socket society! But it's easy to join:
 Our required readings are:

 Open Socket command
 Close Socket command
 Accept command

You got off easy. I had to stay after school and read

write to socket
read from socket

-- 
-Mark Wieder
 [EMAIL PROTECTED]

___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: Sockets

2005-12-11 Thread Dave Cragg


On 11 Dec 2005, at 16:49, Björnke von Gierke wrote:


Of course there is a secret Socket society! But it's easy to join:
Our required readings are:

Open Socket command
Close Socket command
Accept command

If these don't help you, then you need to ask either on the use  
list or in chatrev :)



You forgot to mention the secret handshake. :-)

Dave___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: Sockets

2005-12-11 Thread Graham Samuel
On Sun, 11 Dec 2005 08:32:55 -0800, Jim Hurley  
[EMAIL PROTECTED] wrote:



Now all I need to do is find out was a socket is. I know it must have
something to do with light bulbs.

Searched the dictionary for socket and came up with the single
Using URLs, uploading, and downloading, 18 pages (copied to Word)
which don't  appear to contain the word socket.

Is there a secret RR society which is privy to this sort of thing?
Can I join? Sock it to me.


I can't answer the question but I would very much like to be around  
when it is answered. When I was younger (**much** younger), I used to  
kind of absorb technical stuff without consciously learning about it,  
but nowadays stuff suddenly comes up and bites me in the rear and I  
wonder where it came from: for me, XML is like that, and so is most  
Internet stuff. Sockets, do we need them and is the term just a token  
or does it carry some metaphorical meaning? And that great forest of  
non-mnemonic clusters of letters like say DHCP - just look at the  
Network Control Panel on a Mac or PC and despair... I've tried to  
read my way into the subject, but it hasn't helped me much. For  
example, I noticed the following in the RR documentation for  
'OpenSockets':


For technical information about the numbers used to designate  
standard ports, see the list of port numbers at http:// 
www.iana.org/assignments/port-numbers, in particular the section  
titled Well Known Port Numbers.


Following that link led to something surreal as far as I could see:  
what are all those individuals doing in there? And who or what is  
IANA? OK, I know I'm out of my depth.


Let's hope Andre can help us (on sockets, not the other stuff).

Graham

 
---

Graham Samuel / The Living Fossil Co. / UK and France

___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: Sockets

2005-12-11 Thread Alex Tweedly

Graham Samuel wrote:



I can't answer the question but I would very much like to be around  
when it is answered. When I was younger (**much** younger), I used to  
kind of absorb technical stuff without consciously learning about it,  
but nowadays stuff suddenly comes up and bites me in the rear and I  
wonder where it came from: for me, XML is like that, and so is most  
Internet stuff.


:-)

Sockets, do we need them and is the term just a token  or does it 
carry some metaphorical meaning? 


It does carry some meaning - the idea was that you could plug together 
different programs. You make connections between sockets


And that great forest of  non-mnemonic clusters of letters like say 
DHCP - just look at the  Network Control Panel on a Mac or PC and 
despair... I've tried to  read my way into the subject, but it hasn't 
helped me much. For  example, I noticed the following in the RR 
documentation for  'OpenSockets':


DHCP - Dynamic Host Config ProtocolCan't think of a more mnemonic 
acronym for it.


For technical information about the numbers used to designate  
standard ports, see the list of port numbers at http:// 
www.iana.org/assignments/port-numbers, in particular the section  
titled Well Known Port Numbers.



Following that link led to something surreal as far as I could see:  
what are all those individuals doing in there? And who or what is  
IANA? OK, I know I'm out of my depth.


IANA is the co-ordinating body for various numbers (protocol number, 
port numbers, etc.)


If you need, e.g. a port to be assigned, you need to apply to IANA, with 
a description of why you need a port, what it will be used for, where 
the appropriate documents can be found, etc. (the process is much more 
rigorous nowadays than it used to be). The individuals listed along with 
*some* of the assigned ports are the individuals who sent in the 
application.




Let's hope Andre can help us (on sockets, not the other stuff).



--
Alex Tweedly   http://www.tweedly.net



--
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.371 / Virus Database: 267.13.13/197 - Release Date: 09/12/2005

___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: Sockets

2005-12-11 Thread Andre Garzia

BvG,


Also, to become a member of the House Of The Sockets And Ports, one  
should learn the


write to socket
read from socket

commands. I'll publish a little draft today on sockets. The Socket  
Society meets on ChatRev... :-p


cheers
andre

On Dec 11, 2005, at 2:49 PM, Björnke von Gierke wrote:



On Dec 11 2005, at 17:32, Jim Hurley wrote:


...
Searched the dictionary for socket and came up with the single  
Using URLs, uploading, and downloading, 18 pages (copied to  
Word) which don't  appear to contain the word socket.


Is there a secret RR society which is privy to this sort of thing?  
Can I join? Sock it to me.

...


Of course there is a secret Socket society! But it's easy to join:
Our required readings are:

Open Socket command
Close Socket command
Accept command

If these don't help you, then you need to ask either on the use  
list or in chatrev :)


socket society member
Björnke


--

official ChatRev page:
http://chatrev.bjoernke.com

Chat with other RunRev developers:
go stack URL http://homepage.mac.com/bvg/chatrev1.3.rev;

___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your  
subscription preferences:

http://lists.runrev.com/mailman/listinfo/use-revolution


___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: Sockets

2005-12-11 Thread Dave Cragg

This time I'll try to be more helpful.

On 11 Dec 2005, at 21:34, Graham Samuel wrote:


Sockets, do we need them


If you just need to connect to internet URLs, you can use the get  
URL, load URL, etc, calls, and not have to know anything about  
sockets. But if you want to do something more fancy, such as build  
your own web server, mail client, or completely new internet protocol  
(see below), then you probably need to know a little. (But I can tell  
you from my involvement with libUrl, you don't really need to know  
that much, at least if you're doing these kind of things in Rev.)


and is the term just a token or does it carry some metaphorical  
meaning?


Both of those I guess. The term socket is not just a Rev  
expression, but is used in all computer development environments. A  
socket is part of the connection that computers use to communicate  
with each other on TCP/IP networks such as the internet and on  
intranets too.


The following description/analogy may not be strictly accurate, but  
I've found it quite helpful.


Remember those old-fashioned telephone switchbords where the operator  
stuck wires into various holes on the board. Well, imagine your  
computer has a similar board inside with a lot of holes numbered from  
1 to 65000 or thereabouts. And the computer you want to connect to  
(for example, the computer that hosts www.runrev.com) has a similar  
set of holes. To connect your computer to the runrev computer, you  
can imagine connecting a wire in one of the 65000 holes in your  
computer and connecting it one of the holes in the RunRev computer.  
The sockets are the endpoints of the connection. However, with Rev,  
we don't really need to think about the endpoints too much, and it is  
often easier just to think about the connection itself. However, much  
as I'd prefer to script this:


  open connection to www.runrev.com

you have to script this:

  open socket to www.runrev.com #(not quite correct, but see later)

Now remember those 65000 or so holes on the board in your computer,  
and the other 65000 holes on the renRev computer. Well those holes  
are called ports, which is easy enough to understand. So are  
sockets and ports the same? Not exactly as you can open many sockets  
to a single port (Many wires to one hole). But from a Rev  
perspective, they're pretty similar.


Unfortunately, when you want to connect to the runrev computer, you  
can't just connect to any old port (numbered hole) on the runrev  
computer. Many of the ports have specific functions, and you have to  
connect to the right one. For example, if there is a web server   
running on the runrev computer, it is most likely linked to port  
(hole) number 80, as that's the default for web servers.


So when you do something like this:

  get url http://www.runrev.com/index.html;

libUrl assumes that the htpp server is running on port 80, and so  
does the following as part of its stuff:


open socket to www.runrev.com:80

(You *must* include the port number when you open a socket, which is  
why the example earlier was wrong.)


OK. So once you open a socket, what do you do? Well, you write data  
to the socket, and read data from it. (That's about all you can do.)  
If your connecting to a standard server such as a web server, mail  
server, or ftp server, there are protocols which dictate exactly  
what you have to write and read. These protocols are described in  
documents called RFCs which are no fun to read but will help send you  
to sleep when you're on a long flight. (Threaten the kids with one  
for Christmas!)


So rather than wrestling with an established protocol, it's probably  
easier to learn sockets by inventing a brand new protocol. (Really.)  
But to do this, you have to build the server part of the connection  
too. However, this is amazingly easy. The key syntax to running a  
server, is the following script:


  accept connections on port port number with message some handler

But if you want to see how simple this can be to get started, you can  
try running the following client script. I have a Rev server  
running here right now  that implements a simple protocol I invented  
while writing this mail. :-)


To run the client, you need to make a stack with two fields and one  
button. Name the fields in and out. Put some text in field  
in (keep it below 10K to save my bandwidth). Put the following  
script in the button:


on mouseUp
  put 193.109.51.205:8081 into tS
  open socket to tS with message connected
end mouseUp

on connected pS
  put field in into tData
##uncomment following line to see server script
## write script  cr to socket pS
  write length(tData)  cr to socket pS

  write tData to socket pS with message readLineOne
end connected

on readLineOne pS
  read from socket pS for one line with message readmore
end readLineOne

on readmore pS, pData
  if word 1 of pData is a integer then
repeat until length(tRD) = word 1 of pData
  read from socket 

Re: sockets and Windows behavior

2005-02-12 Thread Dar Scott
On Feb 12, 2005, at 8:36 AM, John Rule wrote:
  Maybe the problem is in doing broadcast messages in general on 
Windows
(this same code works fine on OSX...Linux is another issue 
altogether). It
doesn't work consistently (I do not always get the callback to my 
'with'
message, the average is 6 out of 10).

  Using a 'sniffer', I am ALWAYS getting my response from the devices. 
It
seems like it is just that the messages are not always finding their 
way
back to my callback handler (in Windows XP).

Is this a problem, or is there a better way?
If the devices are responding to the ip address and port that sent the 
query, then this might be your problem:  The doc is lacking on using 
UDP.  The callback for 'open datagram socket' is not for open.  (It 
would be sent immediately, if it was.)  It is for read.  Scott Raney 
says to use that instead of read.

If the devices are not responding to the port that sent the broadcast, 
but to some specific port then I guess the above does not apply; you 
would be using accept.  If the messages are very large or a very large 
number comes in at once, then Windows will lose some.  There are some 
system parameters that can be tweeked, but I forgot what they are.

Dar
--
**
DSC (Dar Scott Consulting  Dar's Lab)
http://www.swcp.com/dsc/
Programming Services and Software
**
___
use-revolution mailing list
use-revolution@lists.runrev.com
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: sockets and Windows behavior

2005-02-11 Thread Graham Samuel

On Fri, 11 Feb 2005 15:56:33 -0200, Andre Garzia [EMAIL PROTECTED]  
wrote:

[...]
PS: hum... I think a little network foundations primer would be good...
shall we write one?
If you do, I'd like to be your first customer! I could not even  
reliably describe what a socket is (not really even what kind of a  
concept it is), let alone a datagram...

Graham
 
---
Graham Samuel / The Living Fossil Co. / UK and France

___
use-revolution mailing list
use-revolution@lists.runrev.com
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: sockets and Windows behavior

2005-02-11 Thread Dar Scott
On Feb 11, 2005, at 10:48 AM, John Rule wrote:
 I noticed that when a socket (regular or datagram) is opened to 
Windows
(via my app that is listening on port 1901), an 'alias' port is given
instead of the 'real' one. For example, if my external device 
(computer,
PDA, etc.) connects to socket 192.168.77.10:1901 for communications, 
the
actual socket reported is a random number (like 1407), and it changes 
each
time the device connects (incrementally..1408, 1409, 1410).
In TCP/IP both TCP and UDP uses the notion of ports.
TCP uses connections and might be easier to explain.  When computer or 
device 10.0.0.1 makes a TCP connection to port 1901 on 192.168.77.10, 
it needs to assign a port on 10.0.0.1.  In most socket APIs the program 
requesting the connection may specify the port to use on 10.0.0.1, 
however in most cases it does not and the communications system assigns 
it.  The connection if fully specified by the two address-port pairs.  
Typical socket implementations exploit that and allow multiple 
connections to a passive (listening) end.  Those are all distinct.

So a connection (from the view of 10.0.0.1) is specified by this:
 Remote IP address = 192.168.77.10
 Remote port   = 1901
 Local IP  = 10.0.0.1
 Local port= 1407
Every IP packet has similar information in the header
In Revolution when a connection callback (message) comes in, the IP 
address and the port of the other end are provided.  If the connection 
is broken (or not, actually) and the other end makes another connection 
it is likely to be using another port.  Ports must wait a short time 
before they can be reused, so typically systems just go to the next one 
if a port is not specified.

There are cases in which the process opening the port needs to specify 
the port or at least find out what it is.  Unfortunately there is no 
way to do that in Revolution.  For most protocols this is not needed.  
Since Revolution hides the local port number, if you make multiple 
connections to the same listener, you need to specify an socket id name 
or number in the open.

On the other hand, Revolution accept has no way to specify the IP 
address on a multihomed system.

If you are listening on both TCP and UDP on the same port number, they 
can be confused in Revolution.

UDP is connectionless, but is often handled as though it is a 
connection in sockets implementations and especially the view in 
Revolution.  The same concepts apply roughly.  (UDP is sort of a 
stepchild so folks don't worry about getting it right.  Windows XP 
handles UDP errors poorly.  Most Unix systems don't broadcast in a way 
consistent with the intent of UDP; I argue it is wrong.)

If I missed what you are getting at, I apologize and will try to target 
that.

Dar
--
**
DSC (Dar Scott Consulting  Dar's Lab)
http://www.swcp.com/dsc/
Programming Services and Software
**
___
use-revolution mailing list
use-revolution@lists.runrev.com
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: sockets and Windows behavior

2005-02-11 Thread Alex Tweedly
Dar Scott wrote:
UDP is connectionless, but is often handled as though it is a 
connection in sockets implementations and especially the view in 
Revolution.  The same concepts apply roughly.  (UDP is sort of a 
stepchild so folks don't worry about getting it right.  Windows XP 
handles UDP errors poorly.  Most Unix systems don't broadcast in a way 
consistent with the intent of UDP; I argue it is wrong.)
I'm curious what you're getting at here Dar.
AFAIK, UDP has no concept of broadcast, so I'm left wondering how it can 
be wrong.

Thanks,
-- Alex.
--
Alex Tweedly   http://www.tweedly.net

--
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.300 / Virus Database: 265.8.7 - Release Date: 10/02/2005
___
use-revolution mailing list
use-revolution@lists.runrev.com
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: sockets and Windows behavior

2005-02-11 Thread John Rule
Thank you for the detailed responses everyone!

To make my task even more difficult, I was trying to do a UDP broadcast, and
accept a variable number of responses (unspecified number of devices).

What became confusing was 'when' to parse the data parameter and when to use
the 'with function' call. It was even further complicated by when the
devices responded (when the socket is opened, or when the 'poll' is sent). 

It turned out to be a combination of several things...loads of fun.

JR

___
use-revolution mailing list
use-revolution@lists.runrev.com
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: Sockets

2004-08-27 Thread Scott Slaugh
I have a stack that I have made that provides a library for working
with sockets in Revolution, as well as a front end for the library. 
I'll upload it to revOnline tonight, and you can see if it does what
you need.

Scott Slaugh

On Sat, 28 Aug 2004 06:27:29 +1000, Keith Hutchison
[EMAIL PROTECTED] wrote:
 Hi,
 
 I am looking for a sample runtime revolution stack that has the following
 elements
 
 1. Address Text Box
 2. Port Text Box
 3. Command Text Box
 4. Send Button
 5. Response Text Box
 
 eg Address = 192.168.100.63, Port = 4563 Command = MYOBContacts - Send -
 Receive a long list of MYOBContacts.
 
 I already have this working with REALbasic and our graphic designer desires
 to use Runtime Revolution for the gui.
 
 Any pointers?
 
 Thanks
 
 Keith Hutchison
 Balance-Infosystems.Com
 
 postgresql - mysql - dbf
 Foxpro - Delphi - MS Access - REALbasic
 http://balance-infosytems.com http://realopen.org
 
 ___
 use-revolution mailing list
 [EMAIL PROTECTED]
 http://lists.runrev.com/mailman/listinfo/use-revolution

___
use-revolution mailing list
[EMAIL PROTECTED]
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: Sockets

2004-08-27 Thread Keith Hutchison
Hi Scott,

 I have a stack that I have made that provides a library for working
 with sockets in Revolution, as well as a front end for the library. 
 I'll upload it to revOnline tonight, and you can see if it does what
 you need.

Thanks

Keith Hutchison
Balance-Infosystems.Com

postgresql - mysql - dbf 
Foxpro - Delphi - MS Access - REALbasic
http://balance-infosytems.com http://realopen.org
___
use-revolution mailing list
[EMAIL PROTECTED]
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: Sockets

2004-08-27 Thread Keith Hutchison
Does the following code look correct?

set TheResult to open socket 127.0.0.1:4563 with message MYOBContacts
set the contents of ResultField to TheResult

Keith Hutchison
Balance-Infosystems.Com

postgresql - mysql - dbf 
Foxpro - Delphi - MS Access - REALbasic
http://balance-infosytems.com http://realopen.org
 
___
use-revolution mailing list
[EMAIL PROTECTED]
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: Sockets

2004-08-27 Thread Troy Rollins
On Aug 27, 2004, at 5:35 PM, Keith Hutchison wrote:
Does the following code look correct?
set TheResult to open socket 127.0.0.1:4563 with message 
MYOBContacts
set the contents of ResultField to TheResult
No. There is a lot wrong with it, to be blunt.  ;-)
The first line would probably look like -
open socket to 127.0.0.1:4563 with message MYOBContacts
But - MYOBContacts would be a handler in your scripts which the 
socket connection is going to make a callback to. It is the definition 
of a callback you are making there, not the message sent to the socket. 
That happens with a write command.

The second line looks like it would be creating a custom property... it 
probably wants to look something like -
put theResult into field ResultField

However, TheResult would currently not be holding anything very 
useful. You will need to Read from the socket before and place the 
result of that into a variable.

--
Troy
RPSystems, Ltd.
http://www.rpsystems.net
___
use-revolution mailing list
[EMAIL PROTECTED]
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: Sockets

2004-08-27 Thread Björnke von Gierke
...
set TheResult to open socket 127.0.0.1:4563 with message 
MYOBContacts
set the contents of ResultField to TheResult
...
blocking:
on mouseUp
  open Socket 127.0.0.1:4563
  write MYOBContacts to socket 127.0.0.1:4563
  close socket 127.0.0.1:4563
end mouseUp
nonblocking:
on mouseUp
  Open Socket 127.0.0.1:4563 with message socketOpen
end mouseUp
on socketOpen theIP
  write MYOBContacts to socket theIP with message messageWritten
end socketOpen
on messageWritten theIP
  close socket theIP
end messageWritten
complicated I know :)
Bjoernke
()()()()()()()()()()
Chat with other RunRev developers:
go stack URL http://homepage.mac.com/bvg/chatrev1.1.rev;
___
use-revolution mailing list
[EMAIL PROTECTED]
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: Sockets

2004-08-27 Thread Keith Hutchison
Hi Troy

 No. There is a lot wrong with it, to be blunt.  ;-)

Excellent!! ( Had to start somewhere :-) )

 The first line would probably look like -
 open socket to 127.0.0.1:4563 with message MYOBContacts

 But - MYOBContacts would be a handler in your scripts which the
 socket connection is going to make a callback to. It is the definition
 of a callback you are making there, not the message sent to the socket.
Is defining the call back like defining the name space for the socket?

In realbasic I would do something like this where kjtlTCPCommander is a
socket subclass
which handles all the read and write functions.

  TCPCommander = new kjtlTCPCommander
  TCPCommander.Address = Address
  TCPCommander.Port = Port
  if TCPCommander.Run( Command, Message ) then
AdviseResult( 0, Verbose, Message )
  else
AdviseResult( 1, Verbose, Message )
  end if


 That happens with a write command.

How do you access the socket object?

Keith Hutchison
Balance-Infosystems.Com

postgresql - mysql - dbf
Foxpro - Delphi - MS Access - REALbasic
http://balance-infosytems.com http://realopen.org

___
use-revolution mailing list
[EMAIL PROTECTED]
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: Sockets

2004-08-27 Thread Keith Hutchison
Hi Björnke

Here is the code I have based on your example.
I have breakpoints on each event, however only the first event, mouseup
stops in the debugger.
on mouseUp

open socket 192.168.100.63:4563 with message socketOpen

end mouseUp

on socketOpen theIP

write Hello to socket theIP with message messageWritten

end socketOpen

on messageWritten theIP

close socket theIP

end messageWritten

I know the port is open since I can send a command from a linux command line

extract...

ns2: # PortCommandLiner.mwrb -a 192.168.100.63 -p 4563 -c Hello -v
World

Any further ideas?

Keith Hutchison
Balance-Infosystems.Com

postgresql - mysql - dbf
Foxpro - Delphi - MS Access - REALbasic
http://balance-infosytems.com http://realopen.org





___
use-revolution mailing list
[EMAIL PROTECTED]
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: Sockets

2004-08-27 Thread Troy Rollins
On Aug 27, 2004, at 6:27 PM, Keith Hutchison wrote:
Any further ideas?
Well, are you expecting to read something from the socket, or just 
write to it?

--
Troy
RPSystems, Ltd.
http://www.rpsystems.net
___
use-revolution mailing list
[EMAIL PROTECTED]
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: Sockets

2004-08-27 Thread Keith Hutchison
Hi Troy

Read and write.
Concept is send in a command via tcpip to a server, process the results on
the Runtime Revolution built client.

Keith Hutchison
Balance-Infosystems.Com

postgresql - mysql - dbf
Foxpro - Delphi - MS Access - REALbasic
http://balance-infosytems.com http://realopen.org


___
use-revolution mailing list
[EMAIL PROTECTED]
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: Sockets

2004-08-27 Thread Björnke von Gierke
ok try this modification, there seems to be a problem with the open 
socket command... maybe the socket is already open? the result will 
contain the error information.

on mouseUp
open socket 192.168.100.63:4563 with message socketOpen
if the result   then put the result
end mouseUp
if indeed the socket is already open, then you can close all sockets by 
using the command resetall
I just tested it, and indeed it does not close the socket. Strange, I 
have no idea why that could be?
anyway to read from the socket you need to know either the length of 
the returned data, or the delimiter at the end of the data (ie. return) 
then you can read from your socket

read from socket  192.168.100.63:4563 until return
or
read from socket  192.168.100.63:4563 for 20 chars
why don't you join the chat, we can help you live there :)
type this into the message box:
go stack URL http://homepage.mac.com/bvg/chatrev1.1.rev;
On Aug 28 2004, at 00:27, Keith Hutchison wrote:
Hi Björnke
Here is the code I have based on your example.
I have breakpoints on each event, however only the first event, mouseup
stops in the debugger.
on mouseUp
open socket 192.168.100.63:4563 with message socketOpen
end mouseUp
on socketOpen theIP
write Hello to socket theIP with message messageWritten
end socketOpen
on messageWritten theIP
close socket theIP
end messageWritten
I know the port is open since I can send a command from a linux 
command line

extract...
ns2: # PortCommandLiner.mwrb -a 192.168.100.63 -p 4563 -c Hello -v
World
Any further ideas?

()()()()()()()()()()
Chat with other RunRev developers:
go stack URL http://homepage.mac.com/bvg/chatrev1.1.rev;
___
use-revolution mailing list
[EMAIL PROTECTED]
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: Sockets

2004-08-27 Thread Troy Rollins
On Aug 27, 2004, at 6:47 PM, Keith Hutchison wrote:
Read and write.
Concept is send in a command via tcpip to a server, process the 
results on
the Runtime Revolution built client.
Well then, in your description you are -
opening the socket
once open, writing to the socket
once written, closing the socket
You probably want to have something like -
on messageWritten theIP
read from socket theIP until linefeed with message storeData
end messageWritten
--
on storeData theIP, theMessage
Put theMessage into field resultField
end storeData
Generally, you will keep going back and reading, until some condition 
tells your software to stop that. So the storeData handler may well 
make a new call to read from socket... again, etc.

--
Troy
RPSystems, Ltd.
http://www.rpsystems.net
___
use-revolution mailing list
[EMAIL PROTECTED]
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: Sockets

2004-08-27 Thread Chipp Walters
Keith,
Not sure if you've already answered this, but I've a couple of comments 
for you.

If the server is a webserver, then you can use libURL to access it w/out 
having to mess around with opening and closing sockets.

Just use:
put URL http://www.myserver.com/fred.mydocformat; into fld 1
and check out the post URL command as well.
-Chipp
___
use-revolution mailing list
[EMAIL PROTECTED]
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: Sockets

2004-08-27 Thread Keith Hutchison
Hi Troy

Thanks for your help.

Got it working.

Keith Hutchison
Balance-Infosystems.Com

postgresql - mysql - dbf 
Foxpro - Delphi - MS Access - REALbasic
http://balance-infosytems.com http://realopen.org
___
use-revolution mailing list
[EMAIL PROTECTED]
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: Sockets

2004-08-27 Thread Keith Hutchison
Hi Björnke

Thanks for your online support.
Got it working,

Thanks

Keith Hutchison
Balance-Infosystems.Com

postgresql - mysql - dbf
Foxpro - Delphi - MS Access - REALbasic
http://balance-infosytems.com http://realopen.org

___
use-revolution mailing list
[EMAIL PROTECTED]
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: Sockets

2004-08-27 Thread Scott Slaugh
  I've uploaded my networking library to revOnline.  It is under the
user xslaugh.  I have also uploaded a front end stack, which
demonstrates the use of the library.  This front end contains some
help, and the library has some comments in the script.
  This library currently uses datagram sockets to communicate, since
they worked better for the job I originally designed this stack for. 
Beware that data sent is not verified.  I do plan to add a version
that does not use datagrams to communicate at some point in the
future.
  Any comments on this are welcome!

Scott Slaugh

On Fri, 27 Aug 2004 20:17:43 -0500, Chipp Walters [EMAIL PROTECTED] wrote:
 Keith,
 
 Not sure if you've already answered this, but I've a couple of comments
 for you.
 
 If the server is a webserver, then you can use libURL to access it w/out
 having to mess around with opening and closing sockets.
 
 Just use:
 
 put URL http://www.myserver.com/fred.mydocformat; into fld 1
 
 and check out the post URL command as well.
 
 -Chipp
 
 
 
 ___
 use-revolution mailing list
 [EMAIL PROTECTED]
 http://lists.runrev.com/mailman/listinfo/use-revolution

___
use-revolution mailing list
[EMAIL PROTECTED]
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: Sockets

2004-08-27 Thread Keith Hutchison
Hi Scott

Thanks

The example I ended up with is
http://balance-infosystems.com/applications/tcpcommander/TCPCommanderStack002.rev
I successfully got a list of myob contacts from an middleware application
server written in REALbasic to access a MYOB datafile via ADODB via an MS
access database!
Convoluted I know :-) , but the end result is a list of MYOB contacts from a
win32 resource being displayed on a MacOSX machine, and a happy graphic
designer who doesn't have to grapple with REALbasic...

Many thanks to all who responded.

Keith Hutchison
Balance-Infosystems.Com

postgresql - mysql - dbf
Foxpro - Delphi - MS Access - REALbasic
http://balance-infosytems.com http://realopen.org

___
use-revolution mailing list
[EMAIL PROTECTED]
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: Sockets

2004-03-10 Thread Mark Talluto
On Mar 9, 2004, at 3:12 PM, Springer, Paul wrote:

I am trying to put together some socket code on Windows. The 
documentation
seems clear but there are a couple things that are not as I expected 
and a
simple example would go a long way. Does anyone have such a thing 
handy?
Just a simple accept/connect, send/receive, close example.



-Paul

Hi Paul,

I have just posted a chat program that you might want to take a look at 
in RevNet.

You can also download it from here:  
http://www.canelasoftware.com/pub/rev/chat.rev.gz

--
Best regards,
Mark Talluto
http://www.canelasoftware.com
___
use-revolution mailing list
[EMAIL PROTECTED]
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: Sockets

2004-03-10 Thread Rob Cozens
I am trying to put together some socket code on Windows. The documentation
seems clear but there are a couple things that are not as I expected and a
simple example would go a long way. Does anyone have such a thing handy?
Just a simple accept/connect, send/receive, close example.
Hi Paul,

There is information, including Jan Schenkel's library of Transcript 
socket commands for IPC, available from the revolution_ipc list: 
http://groups.yahoo.com/group/revolution_ipc.
--

Rob Cozens
CCW, Serendipity Software Company
http://www.oenolog.net/who.htm
And I, which was two fooles, do so grow three;
Who are a little wise, the best fooles bee.
from The Triple Foole by John Donne (1572-1631)
___
use-revolution mailing list
[EMAIL PROTECTED]
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: Sockets

2004-03-09 Thread Brian Yennie
This is off the top of my head, but hopefully it helps. It basically 
just expects 1 line of input over the socket, and then echos it back.
Note that you don't have to use the with message syntax, but if you 
don't then your program will block when doing reads and writes from the 
socket, which is bad if you need to handle multiple connections.

on startServer portNum
   accept connections on port portNum with message newConnect
end startServer
on stopServer portNum
  close socket (portNum)
on stopServer
on newConnect s
  read from s for 1 line with message firstLine
end newConnect
on firstLine s,data
  write GOT IT::data to socket s with message doneWriting
end firstLine
on doneWriting s
  close socket s
end doneWriting
on socketTimeout s
  ## a read or write timed out on this socket
end socketTimeout
on socketError s
  ## some other socket-related error
end socketError

I am trying to put together some socket code on Windows. The 
documentation
seems clear but there are a couple things that are not as I expected 
and a
simple example would go a long way. Does anyone have such a thing 
handy?
Just a simple accept/connect, send/receive, close example.


-
Brian Yennie
Chief Technology Officer
QLD Learning, LLC
(941)-362-3199
[EMAIL PROTECTED]
--
___
use-revolution mailing list
[EMAIL PROTECTED]
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: Sockets Behind The Wall

2004-01-21 Thread Andre Garzia
On Jan 21, 2004, at 11:16 PM, Scott Rossi wrote:

I'm trying to establish socket connections behind a router with 
firewall.
(I'm using the little chat demo that Tuviah put together some time 
ago.)  I
assumed I only needed the local (router assigned) addresses of each 
machine,
but either this is wrong or I'm doing something else wrong.

The demo works with both the server and client stacks on the same 
machine,
but when I move the client to another networked machine and point it 
at the
local address of the server stack's machine, nothing seems to happen.  
Ports
are the same, and both machines can see each other on the network.  
Opening
the socket returns empty as if it succeeded and the socket is listed 
in the
openSockets, but no message is returned from the socket upon opening.

Can some kind soul enlighten me as to what I'm doing wrong?

Thanks  Regards,
Scott,

Hell, I hate firewalls!!! :-D I was having similar problems here. First 
you need to check the ports, what port you're using and if this port is 
blocked or not. I'll tell you an ugly and bad solution, actually is not 
a solution, it's just a hack for you to know if the problem is your 
code or your firewall. You can:

A) Change the port you're connecting the stacks to port 80, almost no 
sane firewall will block port 80 for this is the port defined for HTTP 
transport (means web). This port should work, but this is evil for 
you're using a port defined to serve HTTP transport for custom stack 
transport... it's really ugly and against the specs we all love. But it 
should get across the firewall.  You can use this to try the stacks, 
them, if the problem is with the firewall, you must find some port that 
is not being blocked, try high ports like 8080 and the like.

B) You can opt not to use that evil hack above to test your stack, try 
using a high port or contact your sysadmin and ask him for a clear port 
for your usage, this is the peacefull and wise decision. Once you find 
our what port to use, everything will be haven.

You can them look for RevZeroconf external, this will enable your chat 
client to find it's friends across the network without caring for ports 
or ips... this is really handy.

Cheers
Andre
PS: I cannot be sued for the misuse of port 80! :-D



Scott Rossi
Creative Director
Tactile Media, Multimedia  Design
-
E: [EMAIL PROTECTED]
W: http://www.tactilemedia.com
___
use-revolution mailing list
[EMAIL PROTECTED]
http://lists.runrev.com/mailman/listinfo/use-revolution

--
Andre Alves Garzia  2004  BRAZIL
http://studio.soapdog.org
___
use-revolution mailing list
[EMAIL PROTECTED]
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: Sockets Behind The Wall

2004-01-21 Thread Dar Scott
On Wednesday, January 21, 2004, at 06:16 PM, Scott Rossi wrote:

Can some kind soul enlighten me as to what I'm doing wrong?
Sure!

Only, I'm not clear on your setup.

Is it this?

A.
Internet -- Firewall -Client
   |
   Server
Or this?

B.
Client  Internet -- Firewall -Server
Or this?

C.
Client  Firewall - Internet - Firewall Server
If it is A, your firewall (as firewall) should not be a problem.  Just 
point to the private address.

If B or C, the client will need to point to the public address of that 
server for that service.

The firewall will use NAT (network address translation) to translate 
addresses (and ports).

One form is sometimes called masquerade; it represents to the Internet 
all private addresses behind the firewall as (typically) one address 
and ports are shuffled about to accommodate collisions.  This almost 
always applies to clients behind the firewall.

Servers are handled a couple ways.  One is a fixed NAT in which a 
public address is assigned to the whole port space of a computer.  An 
address on the outside is mapped directly to a private address.  
Another method is to assign a port on the public side of the server to 
a port on the private computer.  This keeps the public addresses down.

If the server is behind a firewall, it will normally be handled one of 
those two ways.  The simple SOHO routers usually make it easier for the 
latter.  This works well for an environment that uses masquerade, even 
for a computer supplying a service.  Because of the kinds of things I 
do for customers, I usually have the first.

At my lab, I mix all of the above methods.

So, depending on the situation, you may have to fiddle with the router.

Dar Scott



___
use-revolution mailing list
[EMAIL PROTECTED]
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: Sockets Behind The Wall

2004-01-21 Thread Scott Rossi
On 1/21/04 8:54 PM, Dar Scott [EMAIL PROTECTED] wrote:

 Can some kind soul enlighten me as to what I'm doing wrong?
 
 Sure!
 
 Only, I'm not clear on your setup.
 
 Is it this?
 
 A.
 Internet -- Firewall -Client
   |
   Server
 
 Or this?
 
 B.
 Client  Internet -- Firewall -Server
 
 
 Or this?
 
 C.
 Client  Firewall - Internet - Firewall Server
 
 If it is A, your firewall (as firewall) should not be a problem.  Just
 point to the private address.

That's what I thought.  Your A diagram is the setup I'm testing on, so I
didn't think I needed to use any specially designated port.  But I still
can't seem to get anything happening.  The default port used in the script
is 1987, but I've also used 8080, neither of which seems to make a
difference.  It works fine when client and server stacks are on the same
system, but not when they're on separate local systems.

Anything else I can try?

Regards,

Scott Rossi
Creative Director
Tactile Media, Development  Design
-
E: [EMAIL PROTECTED]
W: http://www.tactilemedia.com

___
use-revolution mailing list
[EMAIL PROTECTED]
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: Sockets Behind The Wall

2004-01-21 Thread Dar Scott
On Wednesday, January 21, 2004, at 10:38 PM, Scott Rossi wrote:

It works fine when client and server stacks are on the same
system, but not when they're on separate local systems.
Anything else I can try?
Make sure you can ping your own address (not just 127.0.0.1) and the 
other address from the client and the server.

You can use netstat on OS X and Windows to look at the connections.  
You should be able to see the server listening even without a client.  
When a client is connected you should be able to see that on either 
machine (tcp).

If your system uses DHCP (or similar method) to assign addresses, they 
might change between boots.  Whoops!  I saw you said the addresses are 
router assigned.  Watch for this.

Some computers might have a personal firewall.

Though unusual, two computers on the same ethernet might not be on the 
same subnet.  There are a few ways this can cause trouble if this is 
the case.

If you have trouble with netstat or ping, holler.  Many on this list 
have used them.

Arg.  I need to read better.  I also saw, in looking back, that the 
client looks like it connects.  What platform(s)?  What Rev versions?  
Recent chat demo stack?  Are any of these computers very slow or 
virtual PCs?

Dar Scott

--

Dar Scott Consulting
http://www.swcp.com/dsc/
Programming Services

___
use-revolution mailing list
[EMAIL PROTECTED]
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: Sockets Behind The Wall

2004-01-21 Thread Andre Garzia
On Jan 22, 2004, at 4:07 AM, Dar Scott wrote:

Though unusual, two computers on the same ethernet might not be on the 
same subnet.  There are a few ways this can cause trouble if this is 
the case.
thats just ugly... :-D Once I stod hours trying to solve a simple 
netbios-samba problem just to realize the subnets were wrong... 
sometimes I hate tcp/ip... and with ipv6 it just get us near the 
obfuscated address holly grail... jeez, I must sleep

--
Andre Alves Garzia  2004  BRAZIL
http://studio.soapdog.org
___
use-revolution mailing list
[EMAIL PROTECTED]
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: Sockets

2002-11-11 Thread Manolo Garrido
Title: Re: Sockets



It is possible with AppleScript, so why shouldn't it with Revolution??

on 11/10/02 20:29, FreakyPhoenix  at [EMAIL PROTECTED] wrote:

I don't believe that is possible. Your computer just won't find your own IP. 

 

FreakyPhoenix

From: Manolo Garrido 
Reply-To: [EMAIL PROTECTED] 
To: 
Subject: Sockets 
Date: Thu, 07 Nov 2002 17:01:00 +0100 
 
 
Does anyone knows if it's possible to develop a synchronous TCP/IP 
communication with Revolution that works when client and server applications 
runs on a single machine over a Mac OS 9? 
 
Thanks 
Manuel 
 
___ 
use-revolution mailing list 
[EMAIL PROTECTED] 
http://lists.runrev.com/mailman/listinfo/use-revolution 


MSN 8 helps ELIMINATE E-MAIL VIRUSES. http://g.msn.com/8HMCEN/2020 Get 2 months FREE*. ___ use-revolution mailing list [EMAIL PROTECTED] http://lists.runrev.com/mailman/listinfo/use-revolution 






Re: Sockets

2002-11-10 Thread FreakyPhoenix

I don't believe that is possible. Your computer just won't find your own IP.

FreakyPhoenix

From: Manolo Garrido <[EMAIL PROTECTED]>
Reply-To: [EMAIL PROTECTED] 
To: <[EMAIL PROTECTED]>
Subject: Sockets 
Date: Thu, 07 Nov 2002 17:01:00 +0100 
 
 
Does anyone knows if it's possible to develop a synchronous TCP/IP 
communication with Revolution that works when client and server applications 
runs on a single machine over a Mac OS 9? 
 
Thanks 
Manuel 
 
___ 
use-revolution mailing list 
[EMAIL PROTECTED] 
http://lists.runrev.com/mailman/listinfo/use-revolution 
MSN 8 helps ELIMINATE E-MAIL VIRUSES.  Get 2 months FREE*.
___
use-revolution mailing list
[EMAIL PROTECTED]
http://lists.runrev.com/mailman/listinfo/use-revolution


RE: Sockets

2002-11-10 Thread Gary Rathbone
Perhaps a slightly different slant but I beleive the IP address of any
computer is 127.0.0.1 as well as the given IP number (either statically or
dynamically assigned). This is what I use in development (for Rev,
Dreamweaver, IIS etc) and it works fine.

I guess it depends on what your trying to do, if you can expand a little
then more suggestions may be offered. Personally, I use multiple Rev stacks
on the same IP number but different HTTP ports. This works fine for what I
want to do.

eg Rev (server) loads a web page to Explorer (client) on 127.0.0.1:8181 and
reply is then captured by Rev listening on this port. In this case there's
no reason why the client can't be Rev.

Regards

Gary Rathbone BSc MBCS
Chartered Information Systems Practitioner


-Original Message-
From: [EMAIL PROTECTED]
[mailto:use-revolution-admin;lists.runrev.com]On Behalf Of FreakyPhoenix 
Sent: 10 November 2002 19:30
To: [EMAIL PROTECTED]
Subject: Re: Sockets


I don't believe that is possible. Your computer just won't find your own IP.

FreakyPhoenix


From: Manolo Garrido
Reply-To: [EMAIL PROTECTED]
To:
Subject: Sockets
Date: Thu, 07 Nov 2002 17:01:00 +0100


Does anyone knows if it's possible to develop a synchronous TCP/IP
communication with Revolution that works when client and server
applications
runs on a single machine over a Mac OS 9?

Thanks
Manuel

___
use-revolution mailing list
[EMAIL PROTECTED]
http://lists.runrev.com/mailman/listinfo/use-revolution



MSN 8 helps ELIMINATE E-MAIL VIRUSES. Get 2 months FREE*.
___ use-revolution mailing list
[EMAIL PROTECTED]
http://lists.runrev.com/mailman/listinfo/use-revolution


___
use-revolution mailing list
[EMAIL PROTECTED]
http://lists.runrev.com/mailman/listinfo/use-revolution



Re: Sockets

2002-11-10 Thread Ken Ray
Actually, Freaky, but there are a number of ways you can get it - I have
some examples that get the MAC address at my site for OS 9, X and Win32, but
you can adjust them slightly to get the IP address of the current machine.
You can see it at:

  http://www.sonsothunder.com/devres/revolution/revolution.htm?_env001

Ken Ray
Sons of Thunder Software
Email: [EMAIL PROTECTED]
Web Site: http://www.sonsothunder.com/

- Original Message -
From: FreakyPhoenix  [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Sunday, November 10, 2002 1:29 PM
Subject: Re: Sockets


 I don't believe that is possible. Your computer just won't find your own
IP.



 FreakyPhoenix



 From: Manolo Garrido
 Reply-To: [EMAIL PROTECTED]
 To:
 Subject: Sockets
 Date: Thu, 07 Nov 2002 17:01:00 +0100
 
 
 Does anyone knows if it's possible to develop a synchronous TCP/IP
 communication with Revolution that works when client and server
applications
 runs on a single machine over a Mac OS 9?
 
 Thanks
 Manuel
 
 ___
 use-revolution mailing list
 [EMAIL PROTECTED]
 http://lists.runrev.com/mailman/listinfo/use-revolution


 --
--
 MSN 8 helps ELIMINATE E-MAIL VIRUSES. Get 2 months FREE*.
___ use-revolution mailing list
[EMAIL PROTECTED]
http://lists.runrev.com/mailman/listinfo/use-revolution

___
use-revolution mailing list
[EMAIL PROTECTED]
http://lists.runrev.com/mailman/listinfo/use-revolution



Re: sockets

2002-07-12 Thread Dar Scott


On Friday, July 12, 2002, at 02:22 AM, Larry Forsgren wrote:

 In sending commands to the mail server I used linefeed
 as described in the Revolution documentation
    write command  linefeed to socket socket
 This certainly does not work on Windows but replacing
 linefeed with CRLF works just fine as someone pointed out.
    write command  CRLF to socket socket

This is a characteristic of the protocol, not Windows.  (I'm 
assuming that POP is like SMTP and does use crlf as the line end.)  
Your pop client code will be able to port to other platforms 
without your changing this.

(Good catch, Shao Sean!)

Dar Scott

___
use-revolution mailing list
[EMAIL PROTECTED]
http://lists.runrev.com/mailman/listinfo/use-revolution



Re: sockets

2002-07-10 Thread Dar Scott


On Tuesday, July 9, 2002, at 03:40 PM, Larry Forsgren wrote:

 When trying to run the script again it fails until
 I restart revolution.

Any chance your mailserver is the same computer?  And on Windows?

If so, I may have run into something similar.

Dar Scott

___
use-revolution mailing list
[EMAIL PROTECTED]
http://lists.runrev.com/mailman/listinfo/use-revolution



Re: sockets

2002-07-10 Thread Dar Scott


On Wednesday, July 10, 2002, at 01:28 PM, Larry Forsgren wrote: 
 Unfortunately not. The mail server is on Unix (and I have tried a few
 which give the same result) and the client is on Windows XP. I can open
 the socket and read the welcome from the mail server but not access
 the socket with any command after that. It times out and nothing 
 else happens.
 When I check the socket it is reported as still open.

By openSockets()?  By netstat?
...
 Any chance your mailserver is the same computer?  And on Windows?

 If so, I may have run into something similar.

Is the mail server on the same LAN?  I have seen the same symptoms 
on an XP client to LAN server that I have with W2K to same 
computer.  I think the problem is related to a fast response.  How 
fast is your XP compared to your net?

At the same open where I can't write in the problem I'm seeding, I 
also don't get an open callback.  The socketID is in openSockets 
and the other end thinks it is open and my realtime tcp watcher 
thinks it is open.  Callback failure is so much easier than 
checking write, that I use it as the primary indicator for this 
problem.

On my XP I found that my stack would work just fine for a 
connection out on the Internet but would fail in this manner on my 
LAN.  Is that something you can check?

OK.  This next one is weird, but it won't take long.  This happens 
on my Windows 2000 computers.  Each time before you click the 
button to run your test, grab the title bar of the window with the 
mouse and move the window a little bit.  Then click the button to 
run the test.  If that makes it work, then it is probably the same 
problem.  If not, we don't know.

Of course, it may be something else.  Put in your diagnostics and 
let us know what the results are like.

Dar Scott




___
use-revolution mailing list
[EMAIL PROTECTED]
http://lists.runrev.com/mailman/listinfo/use-revolution



Re: sockets

2002-07-10 Thread Shao Sean

 write USER  user to socket server
try:
write USER  user  CRLF to socket server
remember you need to send the CRLF at the end of every command (just like
SMTP)..

___
use-revolution mailing list
[EMAIL PROTECTED]
http://lists.runrev.com/mailman/listinfo/use-revolution



Re: sockets

2002-07-10 Thread Dar Scott


On Wednesday, July 10, 2002, at 01:41 PM, Larry Forsgren wrote:

 Correct, server contains mailsever:110.
 I logged the results to a field but it came up empty.
 The sysError is 0 which I don´t know what it means.
 The actual code as it looks currently is below.
 It does not matter if I change to a different mail server.
  
 on revPOP_connect
   # Description..: connects to the mail account
   # Parameter...: server, user, losen
   set socketTimeoutInterval to 1000
   put item 1 of param(1)  :110 into server
   put item 2 of param(1) into user
   put item 3 of param(1) into losen
   open socket server
   read from socket server until linefeed
   if offset(+OK,it) is zero then
  answer the sysError
  close socket server
  answer No connection!
    else
  put Connected to  server  return into field id 1004
  write USER  user to socket server
  read from socket server until linefeed
  put return  it after field id 1004
   end if
 end revPOP_connect


The sysError is meaningful in some cases (all sockets) if result is 
not empty.  For this case it will be a Winsock error code.

You may need to step back and do a little more on diagnostics.

Add a multiline field named log, maybe with a scrollbar.  (I 
would also make a test button on a different card that does the 
bare i/o, but you can do this in your code if you want.)

Add this:

on clearLog
put empty into field log
-- clear base for long seconds if you add that later
end clearLog

on logIt loggedEvent
-- add putting long seconds delta into log if you want
-- add other info if you want
put loggedEvent  linefeed after field log
 -- add openSockets if you want
 -- add something to force scrolling if you want
end logIt

on logResult loggedEvent, resultVal, sysErrVal
logIt loggedEvent \
 result =   quote  resultVal  quote \
 sysErro =   sysErrVal
end logIt

on socketError socketID, errorString
logIt socketError   socketIDerror =   quote  
errorString  quote
end socketError

on socketClosed socketID
logIt socketClosed   socketID
end socketClosed

on socketTimeOut socketID
logIt socketTimeOut   socketID
end socketTimOut

Those are off the top of my head and may have errors.  Put them in 
the path where they will be found for callbacks.  The stack should 
work.

Call clearLog at the top of your handler.  You can call it from a 
button instead; if you do you still might want to set the timer 
offset at the top of your handler.

Call the logResult after EVERY socket command with the appropriate 
parameters, like this:
logResult open, the result, the sysError

Use logIt to log the results of read, what you write and so on.  If 
you add the timer, use it whenever you need to log the timer value.

Send results to the list.

Dar Scott

___
use-revolution mailing list
[EMAIL PROTECTED]
http://lists.runrev.com/mailman/listinfo/use-revolution



Re: sockets

2002-07-09 Thread Sarah

Sorry for the long email, but here are the basic routines I use for POP 
communications.
You'll need to customize to fit in with your field names instead of 
mine. Also, check the setupNextCall handler as that is specifically for 
my button ID.

Everything gets logged so debugging is quite easy.

Regards,
Sarah

-
-- these variables are up here so all handlers in this button can use it
local socketAddr, msgList

on mouseUp
   put empty into fld Log
   put empty into fld Email
   put Checking email... into fld Status

   -- close any open sockets (in case there has been a failure already)
   repeat until the openSockets  is empty
 close socket line 1 of the openSockets
   end repeat

   -- open POP port  login (fld POP contains the address of my mail 
server)
   put fld POP  :110 into socketAddr
   open socket to socketAddr with message startEmail
end mouseUp


-- this handler gets called after the socket has opened
on startEmail
   -- read the welcome message from the server
   read from socket socketAddr until CRLF
   put it  cr after fld Log

   -- send all the header stuff, checking for a response after each one
   -- the error checking is in the sendReceive handler
   sendReceive USER   fld User
   sendReceive PASS   the cHiddenPass of fld Password

   getList   -- this puts a list of waiting emails into msgList

   repeat for each line m in msgList
   put Reading email... into fld Status
   put getMsg(msgNum) into newMsg
   put newMsg  cr after fld Email

 -- delete message from server
 -- comment this out while you're testing
 sendReceive DELE   msgNum
   end repeat

   -- close the port before closing the socket
   sendReceive QUIT
   close socket socketAddr

   setupNextCall
end startEmail


on setupNextCall
   -- set up next check, making sure to delete any leftover pending 
messages
   put the pendingMessages into pendMsg
   repeat for each line L in pendMsg
 if L contains button ID 1013 then cancel item 1 of L
   end repeat

   send mouseUp to button ID 1013 in (fld Check * 60) seconds
   put the seconds + (fld Check * 60) into checkTime
   convert checkTime to long time
   put Next check at   checkTime into fld Status
end setupNextCall


-- this function gets the list and extracts the number of waiting emails
on getList
   sendOnly LIST
   read from socket socketAddr until .  CRLF
   put it into msgList
   -- delete header  footer
   put line 2 to -2 of msgList into msgList
   put msgList  cr after fld Log
end getList


-- this function retrieves the whole message if it is small enough
function getMsg msgNum
   sendOnly RETR   msgNum
   read from socket socketAddr until .  CRLF
   return it
end getMsg


-- this routine sends data to the server and reads the response
-- POP responses always start with +OK or -ERR
on sendReceive theData
   put -   theData  cr after fld Log
   write theData  CRLF to socket socketAddr
   read from socket socketAddr until CRLF
   put it after fld Log

   if word 1 of it is not +OK then
 close socket socketAddr
 exit to top
   end if
end sendReceive


-- this routine is for sending only, with no response expected
on sendOnly theData
   put -   theData  cr after fld Log
   write theData  CRLF to socket socketAddr
end sendOnly


-- these 2 handlers are just to catch a connection failure
on socketTimeOut
   close socket socketAddr
   setupNextCall
   exit to top
end socketTimeOut

on socketError sockID, errMsg
   close socket socketAddr
   setupNextCall
   exit to top
end socketError

-



On Wednesday, July 10, 2002, at 10:21  AM, Larry Forsgren wrote:

 Thanks for your reply Sarah,

 I actually did try to close the socket by sending QUIT to it
 using the write command but that didn't change anything.
 I only get a reply from the socket the first time so the quit
 command is not forwarded either. I also tried to wait for the
 connection to time out but I cannot access the socket again
 until I restart Revolution.
 Perhaps someone has a Rev example of how to use sockets
 to access a mail server.
 (I run this on Windows XP if that has any bearing on this).

 Larry


___
use-revolution mailing list
[EMAIL PROTECTED]
http://lists.runrev.com/mailman/listinfo/use-revolution



Re: sockets

2002-07-09 Thread Shao Sean

are you on windows? if so we've noticed that using a socket right after
closing it will fail.. you'll need to give it some time in which to timeout
(as was mentioned by someone else on the list.. they said to lower the
socket timeout)..

- Original Message -
When trying to run the script again it fails until

___
use-revolution mailing list
[EMAIL PROTECTED]
http://lists.runrev.com/mailman/listinfo/use-revolution



Re: sockets

2002-07-09 Thread Dar Scott


On Tuesday, July 9, 2002, at 10:20 PM, Shao Sean wrote:

 are you on windows? if so we've noticed that using a socket right after
 closing it will fail.. you'll need to give it some time in which 
 to timeout
 (as was mentioned by someone else on the list.. they said to lower the
 socket timeout)..

I'd like to learn more of this.  (Stop that quivering, Josh.)

I'm aware of tcp TIME WAIT, and this might be that, but it looks 
like it might be something else.

Dar Scott

___
use-revolution mailing list
[EMAIL PROTECTED]
http://lists.runrev.com/mailman/listinfo/use-revolution



Re: sockets - opening and closing

2002-05-06 Thread Shao Sean

 Did you try in adding the line below to your preopenstack script : 
  set the socketTimeoutInterval to 10
thanks for the tip, i'll give it a try in the next revision of my project

___
use-revolution mailing list
[EMAIL PROTECTED]
http://lists.runrev.com/mailman/listinfo/use-revolution



Re: sockets - opening and closing

2002-05-06 Thread Dave Cragg

Hi

Although not directly relevant to the problems discussed, it's 
probably a good idea to check the result after an open socket 
statement. It seems that if the connection fails to open due to a 
name resolution problem, the error is found in the result, not a 
socketError message.

Cheers
Dave Cragg
___
use-revolution mailing list
[EMAIL PROTECTED]
http://lists.runrev.com/mailman/listinfo/use-revolution



Re: sockets - opening and closing

2002-05-03 Thread Dar Scott


On Friday, May 3, 2002, at 07:18 PM, Shao Sean wrote:

 i've noticed that when creating a TCP socket that opening and 
 closing it a
 few times in a row causes it not to work anymore..

 open
 close
 open -- stops here most of the time

I've seen this kind of thing when the server is the same computer.  
(In that case, the connection is established, but the Revolution 
app doesn't know and can't use it.)  I can't be sure of other cases.

Could the server have put you on a black list?

Are you sure you are closing?  Maybe you have hit the max number of 
connections for that server.

 if you wait a little between the first close and the second open, 
 it will
 sometimes re-connect..

For what I have seen with the same-computer problem, just dragging 
the window, resizing it, or even minimizing and opening it will 
fix it.  But not waiting.  Could we be looking at the same 
problem?

 anyone else notice this, or am i the only one
 hammering? ;-)

I was wondering the same.  I've been doing some tests on basic TCP 
sockets.

 [this feature was noticed in my code as well as the
 'simple server/client' available for download on the runrev website]

I'll look at that.  Or do you have a better stack for demonstrating 
what you have seen?  I have some stacks and some pointers to some 
tools, should you be interested.

 running - windows 2000 sp2

That is where I have seen problems.

It is not consistent machine to machine.

 another user has seen the same problem on macos9

 ___
 use-revolution mailing list
 [EMAIL PROTECTED]
 http://lists.runrev.com/mailman/listinfo/use-revolution


___
use-revolution mailing list
[EMAIL PROTECTED]
http://lists.runrev.com/mailman/listinfo/use-revolution



Re: sockets - opening and closing

2002-05-03 Thread Shao Sean

 I've seen this kind of thing when the server is the same computer.
i'm on the server machine (server and client same machine) and another
client in australia (can't physically get further away from me then that ;-)

--
 Could the server have put you on a black list?
i don't have any such feature... yet =)

--
 Are you sure you are closing?  Maybe you have hit the max number of
closing yes, there's only myself and matt on the server, plus there's no
internally coded limit to the number of users available to connect

--
 For what I have seen with the same-computer problem, just dragging
maybe i'll just throw in a dummy handler before calling the open socket..?

--
 I'll look at that.  Or do you have a better stack for demonstrating
we had both used tuviah's excellent client/server while we were developing
our own (which hasn't been released) and now we use our client/server..

--
 That is where I have seen problems.
 It is not consistent machine to machine.
is anything? ;-)

___
use-revolution mailing list
[EMAIL PROTECTED]
http://lists.runrev.com/mailman/listinfo/use-revolution



Re: sockets - opening and closing

2002-05-03 Thread Dar Scott


On Friday, May 3, 2002, at 08:33 PM, Shao Sean wrote:

 I've seen this kind of thing when the server is the same computer.
 i'm on the server machine (server and client same machine) and another
 client in australia (can't physically get further away from me 
 then that ;-)

I noticed that a Revolution TCP client on W2K will time out in 21 
seconds.  Even Australia to Canada should connect in less than 
that, I think.

In my situation, the connection is actually established.  You might 
try checking with repeated netstat -p TCP.  Or use TCPmon to watch 
connections come and go.  Or, if your server is relatively quiet, 
look at traffic with Ethereal or a similar tool.


 --
 Could the server have put you on a black list?
 i don't have any such feature... yet =)

A stab in the dark.

 --
 Are you sure you are closing?  Maybe you have hit the max number of
 closing yes, there's only myself and matt on the server, plus 
 there's no
 internally coded limit to the number of users available to connect

I had to say that; we are on the use-revolution list.

 --
 For what I have seen with the same-computer problem, just dragging
 maybe i'll just throw in a dummy handler before calling the open 
 socket..?

I tried doing all the same things by script and it did not work.  
(Assuming we are seeing the same thing.)

The behavior on W2K is not the same as on OS X, the only other 
platform I checked.  On OS X, an open will get a socket open 
callback upon establishment, a socketClosed upon refusal, or a 
socketClosed in 75 seconds otherwise.  On Windows 2000, an open 
will get a socket open callback upon establishment (except for your 
and my situations ;-), a socket open callback if refused (delayed 
.9 seconds), and an open callback in 21 seconds if nobody is home.

Dar Scott

___
use-revolution mailing list
[EMAIL PROTECTED]
http://lists.runrev.com/mailman/listinfo/use-revolution