sockets post to url

2010-09-02 Thread Monte Goulding
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


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


IP/UDP Sockets in REV

2010-07-25 Thread Ewan Richardson
Hi there, wondering if someone could help clarify something for me.

 

When creating socket connections using the socket datagram connection, do
you have to create the IP header and UDP header (and related checksums)
within revolution, or does revolution take care of this for you?

 

Thanks for your time.

___
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: IP/UDP Sockets in REV

2010-07-25 Thread Andre Garzia
Ewan,

Revolution does it for you!

:D

On Sun, Jul 25, 2010 at 11:17 AM, Ewan Richardson e...@supremis.co.ukwrote:

 Hi there, wondering if someone could help clarify something for me.



 When creating socket connections using the socket datagram connection, do
 you have to create the IP header and UDP header (and related checksums)
 within revolution, or does revolution take care of this for you?



 Thanks for your time.

 ___
 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: IP/UDP Sockets in REV

2010-07-25 Thread Mark Schonewille

Ewan,

TCP creates the headers for you.

If you mean HTML headers, yes you have to create those yourself when  
using sockets, but not when using the put/get URL commands.


If you want to connect to a server that requires special headers, then  
you have to do this yourself and you will need to get a copy of the  
protocol documentation for that server.


Why do you ask? Are you having a problem with datagram sockets?

--
Best regards,

Mark Schonewille

Economy-x-Talk Consulting and Software Engineering
Homepage: http://economy-x-talk.com
Twitter: http://twitter.com/xtalkprogrammer
KvK: 50277553

Download the Installer Maker plugin for Runtime Revolution at http://qurl.tk/ce

On 25 jul 2010, at 16:17, Ewan Richardson wrote:


Hi there, wondering if someone could help clarify something for me.



When creating socket connections using the socket datagram  
connection, do
you have to create the IP header and UDP header (and related  
checksums)

within revolution, or does revolution take care of this for you?


Thanks for your time.


___
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: IP/UDP Sockets in REV

2010-07-25 Thread Andre Garzia
I think the inquire was related to UDP which is unreliable by default, so
while the checksums and headers guarantee the integrity of a single
datagram, the nature of UDP itself is unreliable by design, still, I like
unreliable things, it adds to the adventurous fellings, you should see my
own personal tools...

On Sun, Jul 25, 2010 at 12:05 PM, Mark Schonewille 
m.schonewi...@economy-x-talk.com wrote:

 Ewan,

 TCP creates the headers for you.

 If you mean HTML headers, yes you have to create those yourself when using
 sockets, but not when using the put/get URL commands.

 If you want to connect to a server that requires special headers, then you
 have to do this yourself and you will need to get a copy of the protocol
 documentation for that server.

 Why do you ask? Are you having a problem with datagram sockets?

 --
 Best regards,

 Mark Schonewille

 Economy-x-Talk Consulting and Software Engineering
 Homepage: http://economy-x-talk.com
 Twitter: http://twitter.com/xtalkprogrammer
 KvK: 50277553

 Download the Installer Maker plugin for Runtime Revolution at
 http://qurl.tk/ce


 On 25 jul 2010, at 16:17, Ewan Richardson wrote:

  Hi there, wondering if someone could help clarify something for me.



 When creating socket connections using the socket datagram connection, do
 you have to create the IP header and UDP header (and related checksums)
 within revolution, or does revolution take care of this for you?


 Thanks for your time.


 ___
 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: IP/UDP Sockets in REV

2010-07-25 Thread Ewan Richardson
Im in the process of writing some tools for ASTERIX radar data (air traffic
control stuff).

The most basic form of this can be UDP over a network. So I can safely
assume that there will be a header of around 28 bytes on the beginning of
the message generated by rev.

That's fairly good news for me, as I have enough to do without checksums! 
Have also run the output through wireshark, which answered my own question!

Already had limited success today with the protocol, so ill keep working
though it.

Thanks for your time.

Ewan
-Original Message-
From: use-revolution-boun...@lists.runrev.com
[mailto:use-revolution-boun...@lists.runrev.com] On Behalf Of Andre Garzia
Sent: 25 July 2010 16:12
To: How to use Revolution
Subject: Re: IP/UDP Sockets in REV

I think the inquire was related to UDP which is unreliable by default, so
while the checksums and headers guarantee the integrity of a single
datagram, the nature of UDP itself is unreliable by design, still, I like
unreliable things, it adds to the adventurous fellings, you should see my
own personal tools...

On Sun, Jul 25, 2010 at 12:05 PM, Mark Schonewille 
m.schonewi...@economy-x-talk.com wrote:

 Ewan,

 TCP creates the headers for you.

 If you mean HTML headers, yes you have to create those yourself when 
 using sockets, but not when using the put/get URL commands.

 If you want to connect to a server that requires special headers, then 
 you have to do this yourself and you will need to get a copy of the 
 protocol documentation for that server.

 Why do you ask? Are you having a problem with datagram sockets?

 --
 Best regards,

 Mark Schonewille

 Economy-x-Talk Consulting and Software Engineering
 Homepage: http://economy-x-talk.com
 Twitter: http://twitter.com/xtalkprogrammer
 KvK: 50277553

 Download the Installer Maker plugin for Runtime Revolution at 
 http://qurl.tk/ce


 On 25 jul 2010, at 16:17, Ewan Richardson wrote:

  Hi there, wondering if someone could help clarify something for me.



 When creating socket connections using the socket datagram 
 connection, do you have to create the IP header and UDP header (and 
 related checksums) within revolution, or does revolution take care of
this for you?


 Thanks for your time.


 ___
 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: IP/UDP Sockets in REV

2010-07-25 Thread Andre Garzia
Ewan,

If you could keep us posted or consider writing a post document about your
experience interfacing with ATC stuff. It is always good to hear about those
developments.

If you need any network help, send us a note.

Cheers
andre

On Sun, Jul 25, 2010 at 3:40 PM, Ewan Richardson e...@supremis.co.ukwrote:

 Im in the process of writing some tools for ASTERIX radar data (air traffic
 control stuff).

 The most basic form of this can be UDP over a network. So I can safely
 assume that there will be a header of around 28 bytes on the beginning of
 the message generated by rev.

 That's fairly good news for me, as I have enough to do without checksums!
 Have also run the output through wireshark, which answered my own question!

 Already had limited success today with the protocol, so ill keep working
 though it.

 Thanks for your time.

 Ewan
 -Original Message-
 From: use-revolution-boun...@lists.runrev.com
 [mailto:use-revolution-boun...@lists.runrev.com] On Behalf Of Andre Garzia
 Sent: 25 July 2010 16:12
 To: How to use Revolution
 Subject: Re: IP/UDP Sockets in REV

 I think the inquire was related to UDP which is unreliable by default, so
 while the checksums and headers guarantee the integrity of a single
 datagram, the nature of UDP itself is unreliable by design, still, I like
 unreliable things, it adds to the adventurous fellings, you should see my
 own personal tools...

 On Sun, Jul 25, 2010 at 12:05 PM, Mark Schonewille 
 m.schonewi...@economy-x-talk.com wrote:

  Ewan,
 
  TCP creates the headers for you.
 
  If you mean HTML headers, yes you have to create those yourself when
  using sockets, but not when using the put/get URL commands.
 
  If you want to connect to a server that requires special headers, then
  you have to do this yourself and you will need to get a copy of the
  protocol documentation for that server.
 
  Why do you ask? Are you having a problem with datagram sockets?
 
  --
  Best regards,
 
  Mark Schonewille
 
  Economy-x-Talk Consulting and Software Engineering
  Homepage: http://economy-x-talk.com
  Twitter: http://twitter.com/xtalkprogrammer
  KvK: 50277553
 
  Download the Installer Maker plugin for Runtime Revolution at
  http://qurl.tk/ce
 
 
  On 25 jul 2010, at 16:17, Ewan Richardson wrote:
 
   Hi there, wondering if someone could help clarify something for me.
 
 
 
  When creating socket connections using the socket datagram
  connection, do you have to create the IP header and UDP header (and
  related checksums) within revolution, or does revolution take care of
 this for you?
 
 
  Thanks for your time.
 
 
  ___
  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: IP/UDP Sockets in REV

2010-07-25 Thread Mark Wieder
Ewan-

Sunday, July 25, 2010, 11:40:16 AM, you wrote:

 Have also run the output through wireshark, which answered my own question!

Cool. Nothing like WireShark for figuring out what's really going on.

-- 
-Mark Wieder
 mwie...@ahsoftware.net

___
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: IP/UDP Sockets in REV

2010-07-25 Thread Ewan Richardson
Hi Andre

Not a problem, I can do that.

Im basically using rev to translate data from our simulator to a wider group
of asterix native clients.
At the moment im implementing CAT62, which is basically used for Sending
SDPS track messages. 
The Asterix protocol is all publicly published by eurocontrol.

The actual asterix protocol is quite diverse, allowing for multiple systems
to track targets and supply the data to radar screens. (im oversimplifying
here but it is the gereral principle.

Another tool im using, which may or may not  be of interest is albatross.
This is an open source air traffic radar screen, for linux. Although there
are a few bugs in there, is a good tool for testing against asterix and
seeing targets painting on screen.

Some of the code could be release for flight sim heads, taking data from a
flight simulator and drawing it on a real atc display.

So far the project is developing pretty quickly (compared to other
languages), and looks like it might be quite a rapid development.

The biggest head-ache so far has been translating latitude and longitude to
binary using two's compliment in a 32bit block.  I think that using
binaryEncode(f*,thedata) is giving the correct results, although I have
yet to test this part. The whole thing is a bit of a learning curve on the
binary front with revolution!.

-Original Message-
From: use-revolution-boun...@lists.runrev.com
[mailto:use-revolution-boun...@lists.runrev.com] On Behalf Of Andre Garzia
Sent: 25 July 2010 20:12
To: How to use Revolution
Subject: Re: IP/UDP Sockets in REV

Ewan,

If you could keep us posted or consider writing a post document about your
experience interfacing with ATC stuff. It is always good to hear about those
developments.

If you need any network help, send us a note.

Cheers
andre

On Sun, Jul 25, 2010 at 3:40 PM, Ewan Richardson e...@supremis.co.ukwrote:

 Im in the process of writing some tools for ASTERIX radar data (air 
 traffic control stuff).

 The most basic form of this can be UDP over a network. So I can safely 
 assume that there will be a header of around 28 bytes on the beginning 
 of the message generated by rev.

 That's fairly good news for me, as I have enough to do without checksums!
 Have also run the output through wireshark, which answered my own
question!

 Already had limited success today with the protocol, so ill keep 
 working though it.

 Thanks for your time.

 Ewan
 -Original Message-
 From: use-revolution-boun...@lists.runrev.com
 [mailto:use-revolution-boun...@lists.runrev.com] On Behalf Of Andre 
 Garzia
 Sent: 25 July 2010 16:12
 To: How to use Revolution
 Subject: Re: IP/UDP Sockets in REV

 I think the inquire was related to UDP which is unreliable by default, 
 so while the checksums and headers guarantee the integrity of a single 
 datagram, the nature of UDP itself is unreliable by design, still, I 
 like unreliable things, it adds to the adventurous fellings, you 
 should see my own personal tools...

 On Sun, Jul 25, 2010 at 12:05 PM, Mark Schonewille  
 m.schonewi...@economy-x-talk.com wrote:

  Ewan,
 
  TCP creates the headers for you.
 
  If you mean HTML headers, yes you have to create those yourself when 
  using sockets, but not when using the put/get URL commands.
 
  If you want to connect to a server that requires special headers, 
  then you have to do this yourself and you will need to get a copy of 
  the protocol documentation for that server.
 
  Why do you ask? Are you having a problem with datagram sockets?
 
  --
  Best regards,
 
  Mark Schonewille
 
  Economy-x-Talk Consulting and Software Engineering
  Homepage: http://economy-x-talk.com
  Twitter: http://twitter.com/xtalkprogrammer
  KvK: 50277553
 
  Download the Installer Maker plugin for Runtime Revolution at 
  http://qurl.tk/ce
 
 
  On 25 jul 2010, at 16:17, Ewan Richardson wrote:
 
   Hi there, wondering if someone could help clarify something for me.
 
 
 
  When creating socket connections using the socket datagram 
  connection, do you have to create the IP header and UDP header (and 
  related checksums) within revolution, or does revolution take care 
  of
 this for you?
 
 
  Thanks for your time.
 
 
  ___
  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

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


Sockets

2010-04-27 Thread Hershel Fisch
Hi, could any help me out with a full socket session ? Please!
Thanks, Hershel
___
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: Ideas to simulate a multithreaded sockets server

2010-03-01 Thread Marcio Alexandroni
Hi,

I made some progress on this topic and I think I Rev+CGI can do the job.

While waiting for revServer, I decided to try CGI with Rev to see if it fits
my needs. Of course, I had to use the 3.5 standalone engine, as v4.0.0 does
not include the standalone engine anymore.

First of all, I searched for a multiplatform, tiny,
easy-to-install-and-configure web server on the market. Of course there is
Apache, but I found Abyss Web Server by aprelium
(http://www.aprelium.com/abyssws/). There is a free version for personal use
and for commercial use it's only $59. It supports Windows, Linux, Mac,
FreeBSD.

The web server setup is easy and done with the browser, I just had to add a
new interpreter, set the executable to the Rev standalone, set the -ui
argument and the irev extension for the RevLets and now I can access the
RevLets with the irev extension direct from the browser. I didn't have
to set any permission for the file.

I needed database access to PostgreSQL, so I just had to point the directory
where revdb.bundle and dbpostgresql.bundle (Mac files) are located in the
set the externals of this stack clause.

I built a Rev Stack for common functions and used the start using clause
in the RevLet and now I can create the logic all in the Rev Stack, with
source code protected!

I was using vi to edit my files and I was not happy with it, of course...
Then, last night Stephen Barncard (thank you!!!) released the Rev colour
syntax for coda, now my work seems to be complete!

All seems to be working fine, I can move on and try the connections on the
PDAs, then rewrite my application logic on the PDA to communicate through
HTTP and see what happens.

When revServer comes up, I think I can move without deep changes, as the
RevLets are Rev!!!

Regards,

Marcio Alexandroni
www.cialogica.com.br
 ( (+55 11) 9989-8316
Skype: marcioalexandroni
Brazil
-- 


___
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: Ideas to simulate a multithreaded sockets server

2010-03-01 Thread Pierre Sahores
Seems realy cool and as long as a dedicated server will be used, Abyss  
httpd will be realy usefull !


Best Regards,

P.

Le 1 mars 10 à 12:18, Marcio Alexandroni a écrit :


Hi,

I made some progress on this topic and I think I Rev+CGI can do the  
job.


While waiting for revServer, I decided to try CGI with Rev to see if  
it fits
my needs. Of course, I had to use the 3.5 standalone engine, as  
v4.0.0 does

not include the standalone engine anymore.

First of all, I searched for a multiplatform, tiny,
easy-to-install-and-configure web server on the market. Of course  
there is

Apache, but I found Abyss Web Server by aprelium
(http://www.aprelium.com/abyssws/). There is a free version for  
personal use

and for commercial use it's only $59. It supports Windows, Linux, Mac,
FreeBSD.

The web server setup is easy and done with the browser, I just had  
to add a
new interpreter, set the executable to the Rev standalone, set the - 
ui
argument and the irev extension for the RevLets and now I can  
access the
RevLets with the irev extension direct from the browser. I  
didn't have

to set any permission for the file.

I needed database access to PostgreSQL, so I just had to point the  
directory
where revdb.bundle and dbpostgresql.bundle (Mac files) are located  
in the

set the externals of this stack clause.

I built a Rev Stack for common functions and used the start using  
clause
in the RevLet and now I can create the logic all in the Rev Stack,  
with

source code protected!

I was using vi to edit my files and I was not happy with it, of  
course...
Then, last night Stephen Barncard (thank you!!!) released the Rev  
colour

syntax for coda, now my work seems to be complete!

All seems to be working fine, I can move on and try the connections  
on the
PDAs, then rewrite my application logic on the PDA to communicate  
through

HTTP and see what happens.

When revServer comes up, I think I can move without deep changes, as  
the

RevLets are Rev!!!

Regards,

Marcio Alexandroni
www.cialogica.com.br
( (+55 11) 9989-8316
Skype: marcioalexandroni
Brazil
--


___
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



--
Pierre Sahores
mobile : (33) 6 03 95 77 70

www.wrds.com
www.sahores-conseil.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: Ideas to simulate a multithreaded sockets server

2010-02-27 Thread Bernard Devlin
On Fri, Feb 26, 2010 at 6:28 PM, Marcio Alexandroni
mar...@cialogica.com.br wrote:
 The applications runs pure TCP/IP with a custom protocol to exchange data
 and it handles dozens of simultaneous calls at the same time, this is why it
 must be multithreaded, the queuing will not work in this case because of the
 time it would need to respond to the last caller.

Hello Marcio, your fellow Brazilian is one of the experts on rev-built
http servers, so I'm sure he'll answer your question in detail soon.

However, whilst he's sleeping, let me just point you to this
mechanism: http://www2.sahores-conseil.com/insead/index_en.html .
Pierre used that mechanism deployed (I believe) to the French Ministry
of Education, and it was a system used by students across France.
Since you need raw TCP/IP it doesn't sound like it will meet your
needs.

Whilst Rev is not multi-threaded, can I just ask if you are using the
following format in your code:

accept [datagram] connections on port number with message callbackMessage

If so, then elsewhere in your code you may be able use the following
structure at places where you can accept potential interruptions:

wait 10 milliseconds with messages

When an existing connection's processing gets temporarily suspended by
the wait, it means that a new connection can be accepted and
processing for that new connection can begin.

These two together can provide a kind of message-passing concurrency.
For example, that is similar to the way that 'concurrent' processing
is done in Tcl (http://www.stanford.edu/~ouster/cgi-bin/papers/threads.pdf)
,

Regards,

Bernard
___
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: Ideas to simulate a multithreaded sockets server

2010-02-27 Thread Marcio Alexandroni
Hi Bernard,

Thanks very much for your suggestions.

I've been reading about Rev and CGI, but I read on rev Forums that the
necessary standalone engine necessary for the cgi-bin support is available
only on Rev = 3.5, the new versions do not have the standalone engine
anymore. Do you know if it's true?

On the other side, I'll test your suggestion on waiting with messages where
it could take longer to answer, I'll do it right now.

Regards,

Marcio Alexandroni
 ( (+55 11) 9989-8316
Skype: marcioalexandroni
Brazil
-- 



 From: Bernard Devlin bdrun...@gmail.com
 Reply-To: How to use Revolution use-revolution@lists.runrev.com
 Date: Sat, 27 Feb 2010 09:43:17 +
 To: How to use Revolution use-revolution@lists.runrev.com
 Subject: Re: Ideas to simulate a multithreaded sockets server
 
 On Fri, Feb 26, 2010 at 6:28 PM, Marcio Alexandroni
 mar...@cialogica.com.br wrote:
 The applications runs pure TCP/IP with a custom protocol to exchange data
 and it handles dozens of simultaneous calls at the same time, this is why it
 must be multithreaded, the queuing will not work in this case because of the
 time it would need to respond to the last caller.
 
 Hello Marcio, your fellow Brazilian is one of the experts on rev-built
 http servers, so I'm sure he'll answer your question in detail soon.
 
 However, whilst he's sleeping, let me just point you to this
 mechanism: http://www2.sahores-conseil.com/insead/index_en.html .
 Pierre used that mechanism deployed (I believe) to the French Ministry
 of Education, and it was a system used by students across France.
 Since you need raw TCP/IP it doesn't sound like it will meet your
 needs.
 
 Whilst Rev is not multi-threaded, can I just ask if you are using the
 following format in your code:
 
 accept [datagram] connections on port number with message callbackMessage
 
 If so, then elsewhere in your code you may be able use the following
 structure at places where you can accept potential interruptions:
 
 wait 10 milliseconds with messages
 
 When an existing connection's processing gets temporarily suspended by
 the wait, it means that a new connection can be accepted and
 processing for that new connection can begin.
 
 These two together can provide a kind of message-passing concurrency.
 For example, that is similar to the way that 'concurrent' processing
 is done in Tcl (http://www.stanford.edu/~ouster/cgi-bin/papers/threads.pdf)
 ,
 
 Regards,
 
 Bernard
 ___
 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: Ideas to simulate a multithreaded sockets server

2010-02-27 Thread Marcio Alexandroni
Hi Bernard,

I visited the page about the mechanism you pointed, but in that case it has
an Apache/PHP server that handles multiple concurrent connections but it
ends up passing the request to a Rev application using Sockets that will
cause the same queuing on message processing. In fact, the requests to the
server are multithreaded but the processing is not, as I could understand.
Did I understand it right?

Regards,

Marcio Alexandroni
www.cialogica.com.br
 ( (11) 9989-8316
  marcioalexandroni
-- 



 From: Bernard Devlin bdrun...@gmail.com
 Reply-To: How to use Revolution use-revolution@lists.runrev.com
 Date: Sat, 27 Feb 2010 09:43:17 +
 To: How to use Revolution use-revolution@lists.runrev.com
 Subject: Re: Ideas to simulate a multithreaded sockets server
 
 On Fri, Feb 26, 2010 at 6:28 PM, Marcio Alexandroni
 mar...@cialogica.com.br wrote:
 The applications runs pure TCP/IP with a custom protocol to exchange data
 and it handles dozens of simultaneous calls at the same time, this is why it
 must be multithreaded, the queuing will not work in this case because of the
 time it would need to respond to the last caller.
 
 Hello Marcio, your fellow Brazilian is one of the experts on rev-built
 http servers, so I'm sure he'll answer your question in detail soon.
 
 However, whilst he's sleeping, let me just point you to this
 mechanism: http://www2.sahores-conseil.com/insead/index_en.html .
 Pierre used that mechanism deployed (I believe) to the French Ministry
 of Education, and it was a system used by students across France.
 Since you need raw TCP/IP it doesn't sound like it will meet your
 needs.
 
 Whilst Rev is not multi-threaded, can I just ask if you are using the
 following format in your code:
 
 accept [datagram] connections on port number with message callbackMessage
 
 If so, then elsewhere in your code you may be able use the following
 structure at places where you can accept potential interruptions:
 
 wait 10 milliseconds with messages
 
 When an existing connection's processing gets temporarily suspended by
 the wait, it means that a new connection can be accepted and
 processing for that new connection can begin.
 
 These two together can provide a kind of message-passing concurrency.
 For example, that is similar to the way that 'concurrent' processing
 is done in Tcl (http://www.stanford.edu/~ouster/cgi-bin/papers/threads.pdf)
 ,
 
 Regards,
 
 Bernard
 ___
 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: Ideas to simulate a multithreaded sockets server

2010-02-27 Thread Pierre Sahores

Hi Marcio,

Did you have an eye to the on-rev / irev technology. It's definitively  
the most usable way to go, from yet. Even if CGI and PHP/Rev Stacks  
went good underground ways to use, over the 15 past yahrs, the  
revServer witch will be made public and free available in the  
forecoming months by RunRev is a very stable et fast running engine  
from yet.


About your multi-threading need, i can't help, for yet, as long as we  
can't see how the revServer is / is'nt able for yet (it could be, at  
least with a adapted xinetd config under linux - i did so for metacard/ 
suse, yahrs ago) to handle multi-thread.


Instead of devlopping your own framework first, why would you not try  
to test your project design in using the on-rev platform ? I use it  
for my own (two projects up and running, the thirst is on desk) with  
great satisfaction.


Kind regards,

P.

Le 27 févr. 10 à 12:31, Marcio Alexandroni a écrit :


Hi Bernard,

I visited the page about the mechanism you pointed, but in that case  
it has
an Apache/PHP server that handles multiple concurrent connections  
but it
ends up passing the request to a Rev application using Sockets that  
will
cause the same queuing on message processing. In fact, the requests  
to the
server are multithreaded but the processing is not, as I could  
understand.

Did I understand it right?

Regards,

Marcio Alexandroni
www.cialogica.com.br
( (11) 9989-8316
 marcioalexandroni
--




From: Bernard Devlin bdrun...@gmail.com
Reply-To: How to use Revolution use-revolution@lists.runrev.com
Date: Sat, 27 Feb 2010 09:43:17 +
To: How to use Revolution use-revolution@lists.runrev.com
Subject: Re: Ideas to simulate a multithreaded sockets server

On Fri, Feb 26, 2010 at 6:28 PM, Marcio Alexandroni
mar...@cialogica.com.br wrote:
The applications runs pure TCP/IP with a custom protocol to  
exchange data
and it handles dozens of simultaneous calls at the same time, this  
is why it
must be multithreaded, the queuing will not work in this case  
because of the

time it would need to respond to the last caller.


Hello Marcio, your fellow Brazilian is one of the experts on rev- 
built

http servers, so I'm sure he'll answer your question in detail soon.

However, whilst he's sleeping, let me just point you to this
mechanism: http://www2.sahores-conseil.com/insead/index_en.html .
Pierre used that mechanism deployed (I believe) to the French  
Ministry

of Education, and it was a system used by students across France.
Since you need raw TCP/IP it doesn't sound like it will meet your
needs.

Whilst Rev is not multi-threaded, can I just ask if you are using the
following format in your code:

accept [datagram] connections on port number with message  
callbackMessage


If so, then elsewhere in your code you may be able use the following
structure at places where you can accept potential interruptions:

wait 10 milliseconds with messages

When an existing connection's processing gets temporarily suspended  
by

the wait, it means that a new connection can be accepted and
processing for that new connection can begin.

These two together can provide a kind of message-passing concurrency.
For example, that is similar to the way that 'concurrent' processing
is done in Tcl (http://www.stanford.edu/~ouster/cgi-bin/papers/threads.pdf 
)

,

Regards,

Bernard
___
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



--
Pierre Sahores
mobile : (33) 6 03 95 77 70

www.wrds.com
www.sahores-conseil.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: Ideas to simulate a multithreaded sockets server

2010-02-27 Thread Pierre Sahores

Marcio,

Le 27 févr. 10 à 12:31, Marcio Alexandroni a écrit :

I visited the page about the mechanism you pointed, but in that case  
it has
an Apache/PHP server that handles multiple concurrent connections  
but it
ends up passing the request to a Rev application using Sockets that  
will

cause the same queuing on message processing.


No under the linux platform if the rev app is launched in root mode  
without GUI front-end. In this case, each new Apache/PHP request to  
the rev process launches its own sub-thread witch appears as a  
separate httpd thread line in the Top controller window. In other  
words, it's not the rev process witch handle the multi-thtrading safty  
but the HTTPd / xinetd one, just in the same way it works for MySQL,  
as an other example.


Best Regards,
--
Pierre Sahores
mobile : (33) 6 03 95 77 70

www.wrds.com
www.sahores-conseil.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: Ideas to simulate a multithreaded sockets server

2010-02-27 Thread Marcio Alexandroni
Hi Pierre,

Thanks for the clarification, I forgot the Linux core forks the process
creating other instances of the application, great.

What I'm looking for is a way to have an easy-to-install and portable server
that I can deploy to Linux, Windows and Mac with the same protocol. Today I
have a server written in Delphi, but that I can only deploy to Windows.

Today I have a custom protocol built with TCP/IP that I can rewrite for the
PDAs when I find the right technology for the server.

I just moved to on-rev hosting, so I have access to the irev technology. Do
you have any information on what platforms revServer will be available
(Linux, Windows, Mac?) and how and if it will integrate with web servers
(apache, others?).

Your suggestion on irev is great, I'll start testing on my on-rev host and
wait for the revServer.

Regards,

Marcio Alexandroni
 ( (+55 11) 9989-8316
Skype marcioalexandroni
Brasil
-- 



 From: Pierre Sahores psaho...@free.fr
 Reply-To: How to use Revolution use-revolution@lists.runrev.com
 Date: Sat, 27 Feb 2010 13:21:13 +0100
 To: How to use Revolution use-revolution@lists.runrev.com
 Subject: Re: Ideas to simulate a multithreaded sockets server
 
 Marcio,
 
 Le 27 févr. 10 à 12:31, Marcio Alexandroni a écrit :
 
 I visited the page about the mechanism you pointed, but in that case
 it has
 an Apache/PHP server that handles multiple concurrent connections
 but it
 ends up passing the request to a Rev application using Sockets that
 will
 cause the same queuing on message processing.
 
 No under the linux platform if the rev app is launched in root mode
 without GUI front-end. In this case, each new Apache/PHP request to
 the rev process launches its own sub-thread witch appears as a
 separate httpd thread line in the Top controller window. In other
 words, it's not the rev process witch handle the multi-thtrading safty
 but the HTTPd / xinetd one, just in the same way it works for MySQL,
 as an other example.
 
 Best Regards,
 --
 Pierre Sahores
 mobile : (33) 6 03 95 77 70
 
 www.wrds.com
 www.sahores-conseil.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


___
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: Ideas to simulate a multithreaded sockets server

2010-02-27 Thread Pierre Sahores

Rebonjour Marcio,


Hi Pierre,

Thanks for the clarification, I forgot the Linux core forks the  
process

creating other instances of the application, great.


Always so usefull, in practice ;-)


What I'm looking for is a way to have an easy-to-install and  
portable server
that I can deploy to Linux, Windows and Mac with the same protocol.  
Today I
have a server written in Delphi, but that I can only deploy to  
Windows.


RevServer will feet this need as you expect.


Today I have a custom protocol built with TCP/IP that I can rewrite  
for the

PDAs when I find the right technology for the server.


If the PDA part relies on a web browser client and the server part on  
on-rev, the onest need is to use an authentication model able to suit  
the PDA while its IP changes, some times minute after minute.


If you own such a PDA or iPhone, you can test the way i handle such  
authentication model in visiting and creating your iDesk acount at http://www.wrds.com 
. Be carefull about the fact that the site is'nt in itself yet  
optimised for mobile device displays, only the authentication one is,  
at this point. All the server code relies entierly on a .irev lib +  
js. No AJAX at this point because i wanted to learn all about irev  
before.


I just moved to on-rev hosting, so I have access to the irev  
technology.


Very good tech, full usable in production mode from yet and i hope to  
deliver my first ASP solution relying on on-rev in the forecoming weeks.



Do
you have any information on what platforms revServer will be available
(Linux, Windows, Mac?)


RunRev has decided to make the RevServer available under those three  
platforms. I would prefer to see each one available after an other (1.  
Linux, 2. OSX or Windows, 3. the last one of OSX or Windows) in the  
sense of such a one delivry after an other would probably help  
RunRev to delivry

- a strong message to the Linux world n-tier devloppers community
- a strong message to the .NET world n-tier devloppers community
- a well incremented marketing message about the RunRev devlop once,  
deploy anyware policy



and how and if it will integrate with web servers
(apache, others?).


Can tell, at this point.


Your suggestion on irev is great, I'll start testing on my on-rev  
host and

wait for the revServer.


You're welcome :D

Best Regards,

P.


Regards,

Marcio Alexandroni
( (+55 11) 9989-8316
Skype marcioalexandroni
Brasil
--




From: Pierre Sahores psaho...@free.fr
Reply-To: How to use Revolution use-revolution@lists.runrev.com
Date: Sat, 27 Feb 2010 13:21:13 +0100
To: How to use Revolution use-revolution@lists.runrev.com
Subject: Re: Ideas to simulate a multithreaded sockets server

Marcio,

Le 27 févr. 10 à 12:31, Marcio Alexandroni a écrit :


I visited the page about the mechanism you pointed, but in that case
it has
an Apache/PHP server that handles multiple concurrent connections
but it
ends up passing the request to a Rev application using Sockets that
will
cause the same queuing on message processing.


No under the linux platform if the rev app is launched in root mode
without GUI front-end. In this case, each new Apache/PHP request to
the rev process launches its own sub-thread witch appears as a
separate httpd thread line in the Top controller window. In other
words, it's not the rev process witch handle the multi-thtrading  
safty

but the HTTPd / xinetd one, just in the same way it works for MySQL,
as an other example.

Best Regards,
--
Pierre Sahores
mobile : (33) 6 03 95 77 70

www.wrds.com
www.sahores-conseil.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



___
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



--
Pierre Sahores
mobile : (33) 6 03 95 77 70

www.wrds.com
www.sahores-conseil.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: Ideas to simulate a multithreaded sockets server

2010-02-27 Thread Bernard Devlin
On Sat, Feb 27, 2010 at 11:17 AM, Marcio Alexandroni
mar...@cialogica.com.br wrote:
 I've been reading about Rev and CGI, but I read on rev Forums that the
 necessary standalone engine necessary for the cgi-bin support is available
 only on Rev = 3.5, the new versions do not have the standalone engine
 anymore. Do you know if it's true?


Yes this is true.  It is a great pity and I do not find the reasons
for this move entirely convincing. If you are a licensed user, it
might be possible to get the 3.5 engine from Runrev (actually, I think
you just need the RevStudio 3.5 for your platform,and I think the
standalone engine is bundled comes in there).

There is supposed to be a rev-server released.  I had thought it was
going to be an apache module to get beyond the problem of any delays
with a fork from CGI.  However, no information has been forthcoming,
and it seems no one outside RunRev knows what was offered and what
will actually be delivered, or when.

I seem to remember that within on-rev it is not possible to open
sockets.  I think there was a talk at the Rev2009 conference by BvG
who developed the Rev chat server.  I am not so interested in on-rev,
so I didn't pay that much attention, but I thought he said that
sockets could not be opened with on-rev, and that was the reason why
he switch to a HTTP based protocol.  I'm sure someone else will
comment on this soon if I'm mistaken.

BTW you still did not mention if you are using sockets and with
message.  Unless there is some reason why that will not work, your
concerns about threading may prove unnecessary.

Bernard
___
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: Ideas to simulate a multithreaded sockets server

2010-02-27 Thread Marcio Alexandroni
Hi Bernard,

Pierre has posted here RevServer may support all the features I need in
full. In fact I have moved to the on-rev hosting, so I'll start testing the
connection from the PDAs using Sockets from my applications, I think I can
rewrite the protocol to use HTTP.

I tried your suggestion on wait with messages but it causes problems in
the message processing, I couldn't find the exact reason, but as the message
handler deals with databases and deals with encrypted packages, I think
something was not handled quite well when two clients connect at the same
time.

Again, thanks for your ideas on it.

Regards,

Marcio Alexandroni
www.cialogica.com.br
 ( (+55 11) 9989-8316
Skype:  marcioalexandroni
Brasil
-- 



 From: Bernard Devlin bdrun...@gmail.com
 Reply-To: How to use Revolution use-revolution@lists.runrev.com
 Date: Sat, 27 Feb 2010 14:04:50 +
 To: How to use Revolution use-revolution@lists.runrev.com
 Subject: Re: Ideas to simulate a multithreaded sockets server
 
 On Sat, Feb 27, 2010 at 11:17 AM, Marcio Alexandroni
 mar...@cialogica.com.br wrote:
 I've been reading about Rev and CGI, but I read on rev Forums that the
 necessary standalone engine necessary for the cgi-bin support is available
 only on Rev = 3.5, the new versions do not have the standalone engine
 anymore. Do you know if it's true?
 
 
 Yes this is true.  It is a great pity and I do not find the reasons
 for this move entirely convincing. If you are a licensed user, it
 might be possible to get the 3.5 engine from Runrev (actually, I think
 you just need the RevStudio 3.5 for your platform,and I think the
 standalone engine is bundled comes in there).
 
 There is supposed to be a rev-server released.  I had thought it was
 going to be an apache module to get beyond the problem of any delays
 with a fork from CGI.  However, no information has been forthcoming,
 and it seems no one outside RunRev knows what was offered and what
 will actually be delivered, or when.
 
 I seem to remember that within on-rev it is not possible to open
 sockets.  I think there was a talk at the Rev2009 conference by BvG
 who developed the Rev chat server.  I am not so interested in on-rev,
 so I didn't pay that much attention, but I thought he said that
 sockets could not be opened with on-rev, and that was the reason why
 he switch to a HTTP based protocol.  I'm sure someone else will
 comment on this soon if I'm mistaken.
 
 BTW you still did not mention if you are using sockets and with
 message.  Unless there is some reason why that will not work, your
 concerns about threading may prove unnecessary.
 
 Bernard
 ___
 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: Ideas to simulate a multithreaded sockets server

2010-02-27 Thread Björnke von Gierke
Hi

Yes, opening your own sockets is not possible with on-rev. 

If you're not using on-rev:

Using accept ... with message is the first (and most important) step to get 
rev handle several connections concurrently. the second step is to always use 
read/write with message, because otherwise it'd be blocking. Note that 
there's nothing in Rev that will make with message not work, but there's 
several traps that you can step into, which will make it not work. Maybe the 
wait command can produce problems, but I almost never use wait, and haven't 
tested it much. 

If you have computational heavy tasks to do for every connection (several 
seconds for each), then you can't do it with a single rev installation. A way 
around that is to launch command line versions of rev (using the 3.5 cgi engine 
as command line app), and do calculations there. The command line app then 
connects to your server and gives back the result that way. This will introduce 
various other kinds if latencies, and is hugely complex to implement (basically 
adds another server to code and manage). If you're below that limit, send 
message in time is a very important tool to divide larger tasks up so that 
they do not block your server.

If you have large files for each connection (large datasets to transfer, then 
you need chunking and bandwidth controlling. Chunking means to divide the one 
big file into several pieces, and send those after each other. This is needed 
because as long as a script is running, other scripts are blocked, so a single 
large file transfer will block your server for a too long time. Bandwidth 
control means to reduce the speed at which you do things, so as to not send too 
many data at once, which gives the server breathing room for accepting other 
tasks.

Things that won't work:

Giving a connection to another instance of rev: You said you'd like to 
distribute the workload that way. However, the _connection_ is always bound to 
whomever has accepted the socket communication, and there are security rules 
forbidding giving away a socket.

Not using send in time in the read/write to socket commands: Every such command 
will wait and block the _whole_ app until it is done. With network latency, 
this will be a problem for a very busy server (example: chatrev, with it's 
usually 5-6 chatters and less then a message per second does use blocking 
read/writes on the server, and never had a problem with that, not even when 
there where 25 chatters (max amount ever on chatrev)).

On-Rev: This runs within apache, and can only accept http traffic. no custom 
socket, no custom protocols (unless on top of http).

CGI only work with some caveats: cgi's normally run within apache, and can only 
accept http traffic. However they can use custom sockets, and they can be used 
as command line app without apache, where they are more similar to a normal 
standalone sans gui.

High traffic or high bandwidth servers: you will run into high end boundaries, 
with several connections per millisecond, and with big bandwidth demands. I 
have never reached these boundaries, and as long as you're not Word of 
Warcraft, or Google, you won't either.

Bjoernke

On 27 Feb 2010, at 15:11, Marcio Alexandroni wrote:

 Hi Bernard,
 
 Pierre has posted here RevServer may support all the features I need in
 full. In fact I have moved to the on-rev hosting, so I'll start testing the
 connection from the PDAs using Sockets from my applications, I think I can
 rewrite the protocol to use HTTP.
 
 I tried your suggestion on wait with messages but it causes problems in
 the message processing, I couldn't find the exact reason, but as the message
 handler deals with databases and deals with encrypted packages, I think
 something was not handled quite well when two clients connect at the same
 time.
 
 
 From: Bernard Devlin bdrun...@gmail.com
 
 On Sat, Feb 27, 2010 at 11:17 AM, Marcio Alexandroni
 mar...@cialogica.com.br wrote:
 I've been reading about Rev and CGI, but I read on rev Forums that the
 necessary standalone engine necessary for the cgi-bin support is available
 only on Rev = 3.5, the new versions do not have the standalone engine
 anymore. Do you know if it's true?
 
 
 Yes this is true.  It is a great pity and I do not find the reasons
 for this move entirely convincing. If you are a licensed user, it
 might be possible to get the 3.5 engine from Runrev (actually, I think
 you just need the RevStudio 3.5 for your platform,and I think the
 standalone engine is bundled comes in there).
 
 There is supposed to be a rev-server released.  I had thought it was
 going to be an apache module to get beyond the problem of any delays
 with a fork from CGI.  However, no information has been forthcoming,
 and it seems no one outside RunRev knows what was offered and what
 will actually be delivered, or when.
 
 I seem to remember that within on-rev it is not possible to open
 sockets.  I think there was a talk at the Rev2009 conference by BvG
 who

Re: Ideas to simulate a multithreaded sockets server

2010-02-27 Thread Marcio Alexandroni
Hi Bjoernke,

As I could understand, even using accept with message, read with
message, the processing will not be concurrent but queued. If there are 3
connections, it will accept ConnA and queue, ConnB and queue, ConnC and
queue, then will process the queue in line. If I have some reads in depth,
it will be queueing the messages generated after the read.

Did I understood it right?

Thinkig about on-rev and to be able to deploy it, thinkig about RevServer, I
could reimplement my communication protocol over HTTP, with full
multithreading and concurrent support from the Apache and the RevServer
message processing, then I could be handling the messaging system like I do
today, all requests processed immediately.

Thanks for your ideas.

Regards,

Marcio Alexandroni
www.cialogica.com.br
 ( (11) 9989-8316
  marcioalexandroni
-- 



 From: Björnke von Gierke b...@mac.com
 Reply-To: How to use Revolution use-revolution@lists.runrev.com
 Date: Sat, 27 Feb 2010 17:04:05 +0100
 To: How to use Revolution use-revolution@lists.runrev.com
 Subject: Re: Ideas to simulate a multithreaded sockets server
 
 Hi
 
 Yes, opening your own sockets is not possible with on-rev.
 
 If you're not using on-rev:
 
 Using accept ... with message is the first (and most important) step to get
 rev handle several connections concurrently. the second step is to always use
 read/write with message, because otherwise it'd be blocking. Note that
 there's nothing in Rev that will make with message not work, but there's
 several traps that you can step into, which will make it not work. Maybe the
 wait command can produce problems, but I almost never use wait, and haven't
 tested it much. 
 
 If you have computational heavy tasks to do for every connection (several
 seconds for each), then you can't do it with a single rev installation. A way
 around that is to launch command line versions of rev (using the 3.5 cgi
 engine as command line app), and do calculations there. The command line app
 then connects to your server and gives back the result that way. This will
 introduce various other kinds if latencies, and is hugely complex to implement
 (basically adds another server to code and manage). If you're below that
 limit, send message in time is a very important tool to divide larger tasks
 up so that they do not block your server.
 
 If you have large files for each connection (large datasets to transfer, then
 you need chunking and bandwidth controlling. Chunking means to divide the one
 big file into several pieces, and send those after each other. This is needed
 because as long as a script is running, other scripts are blocked, so a single
 large file transfer will block your server for a too long time. Bandwidth
 control means to reduce the speed at which you do things, so as to not send
 too many data at once, which gives the server breathing room for accepting
 other tasks.
 
 Things that won't work:
 
 Giving a connection to another instance of rev: You said you'd like to
 distribute the workload that way. However, the _connection_ is always bound to
 whomever has accepted the socket communication, and there are security rules
 forbidding giving away a socket.
 
 Not using send in time in the read/write to socket commands: Every such
 command will wait and block the _whole_ app until it is done. With network
 latency, this will be a problem for a very busy server (example: chatrev, with
 it's usually 5-6 chatters and less then a message per second does use blocking
 read/writes on the server, and never had a problem with that, not even when
 there where 25 chatters (max amount ever on chatrev)).
 
 On-Rev: This runs within apache, and can only accept http traffic. no custom
 socket, no custom protocols (unless on top of http).
 
 CGI only work with some caveats: cgi's normally run within apache, and can
 only accept http traffic. However they can use custom sockets, and they can be
 used as command line app without apache, where they are more similar to a
 normal standalone sans gui.
 
 High traffic or high bandwidth servers: you will run into high end boundaries,
 with several connections per millisecond, and with big bandwidth demands. I
 have never reached these boundaries, and as long as you're not Word of
 Warcraft, or Google, you won't either.
 
 Bjoernke
 
 On 27 Feb 2010, at 15:11, Marcio Alexandroni wrote:
 
 Hi Bernard,
 
 Pierre has posted here RevServer may support all the features I need in
 full. In fact I have moved to the on-rev hosting, so I'll start testing the
 connection from the PDAs using Sockets from my applications, I think I can
 rewrite the protocol to use HTTP.
 
 I tried your suggestion on wait with messages but it causes problems in
 the message processing, I couldn't find the exact reason, but as the message
 handler deals with databases and deals with encrypted packages, I think
 something was not handled quite well when two clients connect at the same
 time.
 
 
 From: Bernard Devlin bdrun

Ideas to simulate a multithreaded sockets server

2010-02-26 Thread Marcio Alexandroni
Hi,

I'm currently building a new version of a product that has 3 modules:

* A sockets server that operates the application logic.
* The administration module which communicates with the server using sockets
to set properties. 
* The PDA module that is actually what users interact and that also
communicates with the server using sockets.

Today I have the server and administration modules written in Delphi and
Palm/WinMo solutions on the PDAs.

It would be very, very interesting if I could have a server that I could
deploy on Windows, Linux or Mac machines, so I built a test version in
Rev, but I found it does not handle multiple requests, but queues and
process one at a time, which is not suitable for this solution.

I've been thinking if there is any way to overcome this situation, perhaps
launching a separate process for each connection, passing the client address
to this new process, this way I could return immediately from the handler,
letting it process the queue, while the process actually handles the request
and feedback to the client.

Does anyone have any idea if starting multiple Rev subprocesses is possible
or perhaps any other idea on how to do this concurrent handling in Rev?

Thanks in advance.

Marcio Alexandroni
 ( (+55 11) 9989-8316
Brazil
Skype: marcioalexandroni
-- 


___
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: Ideas to simulate a multithreaded sockets server

2010-02-26 Thread Andre Garzia
Oi Marcio,

I think you're now officially the second Brazilian using Revolution. Right
now Rev is single threaded and that is all. What you could build is a pool
of Rev processes coordinated by a master process. So you could have a Linux
standalone launch multiple socket servers and then play the role of proxy
relaying the connection to them. This would involve changing your protocol
since we can't really delegate a connection to another process, you'd need
to reply to the client with something like: hey connect again on port
something and it would reconnect using one of the socket servers.

I don't know your application logic, but if your socket server acts fast
enough then some queueing is not that bad.

In the meanwhile, if you're doing your logic on top of HTTP, why not use a
simple portable server and Rev based CGI, this would solve the problem (and
propose new ones as you'd need to handle the statelessness)

Cheers
andre
PS: Você é de sampa né?

On Fri, Feb 26, 2010 at 2:44 PM, Marcio Alexandroni mar...@cialogica.com.br
 wrote:

 Hi,

 I'm currently building a new version of a product that has 3 modules:

 * A sockets server that operates the application logic.
 * The administration module which communicates with the server using
 sockets
 to set properties.
 * The PDA module that is actually what users interact and that also
 communicates with the server using sockets.

 Today I have the server and administration modules written in Delphi and
 Palm/WinMo solutions on the PDAs.

 It would be very, very interesting if I could have a server that I could
 deploy on Windows, Linux or Mac machines, so I built a test version in
 Rev, but I found it does not handle multiple requests, but queues and
 process one at a time, which is not suitable for this solution.

 I've been thinking if there is any way to overcome this situation, perhaps
 launching a separate process for each connection, passing the client
 address
 to this new process, this way I could return immediately from the handler,
 letting it process the queue, while the process actually handles the
 request
 and feedback to the client.

 Does anyone have any idea if starting multiple Rev subprocesses is possible
 or perhaps any other idea on how to do this concurrent handling in Rev?

 Thanks in advance.

 Marcio Alexandroni
  ( (+55 11) 9989-8316
 Brazil
 Skype: marcioalexandroni
 --


 ___
 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: Ideas to simulate a multithreaded sockets server

2010-02-26 Thread Marcio Alexandroni
Hello Andre,

Thank you for your ideas. It's good to know there are more Brazilians
here... 

The applications runs pure TCP/IP with a custom protocol to exchange data
and it handles dozens of simultaneous calls at the same time, this is why it
must be multithreaded, the queuing will not work in this case because of the
time it would need to respond to the last caller.

Anyway, can you explain a little bit more about the CGI idea and the
portable server? 

Thank you.

PS: moro em Bragança Paulista/SP. Assisti a um video seu, acho que foi da
conferência 08. Abraço.

Marcio Alexandroni
www.cialogica.com.br
 ( (11) 9989-8316
  marcioalexandroni
-- 



 From: Andre Garzia an...@andregarzia.com
 Reply-To: How to use Revolution use-revolution@lists.runrev.com
 Date: Fri, 26 Feb 2010 15:15:39 -0300
 To: How to use Revolution use-revolution@lists.runrev.com
 Subject: Re: Ideas to simulate a multithreaded sockets server
 
 Oi Marcio,
 
 I think you're now officially the second Brazilian using Revolution. Right
 now Rev is single threaded and that is all. What you could build is a pool
 of Rev processes coordinated by a master process. So you could have a Linux
 standalone launch multiple socket servers and then play the role of proxy
 relaying the connection to them. This would involve changing your protocol
 since we can't really delegate a connection to another process, you'd need
 to reply to the client with something like: hey connect again on port
 something and it would reconnect using one of the socket servers.
 
 I don't know your application logic, but if your socket server acts fast
 enough then some queueing is not that bad.
 
 In the meanwhile, if you're doing your logic on top of HTTP, why not use a
 simple portable server and Rev based CGI, this would solve the problem (and
 propose new ones as you'd need to handle the statelessness)
 
 Cheers
 andre
 PS: Você é de sampa né?
 
 On Fri, Feb 26, 2010 at 2:44 PM, Marcio Alexandroni mar...@cialogica.com.br
 wrote:
 
 Hi,
 
 I'm currently building a new version of a product that has 3 modules:
 
 * A sockets server that operates the application logic.
 * The administration module which communicates with the server using
 sockets
 to set properties.
 * The PDA module that is actually what users interact and that also
 communicates with the server using sockets.
 
 Today I have the server and administration modules written in Delphi and
 Palm/WinMo solutions on the PDAs.
 
 It would be very, very interesting if I could have a server that I could
 deploy on Windows, Linux or Mac machines, so I built a test version in
 Rev, but I found it does not handle multiple requests, but queues and
 process one at a time, which is not suitable for this solution.
 
 I've been thinking if there is any way to overcome this situation, perhaps
 launching a separate process for each connection, passing the client
 address
 to this new process, this way I could return immediately from the handler,
 letting it process the queue, while the process actually handles the
 request
 and feedback to the client.
 
 Does anyone have any idea if starting multiple Rev subprocesses is possible
 or perhaps any other idea on how to do this concurrent handling in Rev?
 
 Thanks in advance.
 
 Marcio Alexandroni
  ( (+55 11) 9989-8316
 Brazil
 Skype: marcioalexandroni
 --
 
 
 ___
 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: libUrlFtpUploadFile - reuse open sockets?

2009-04-15 Thread Bernard Devlin
My initial thought on seeing Phil's posting was that it might be a
server setting and thus not something one can control at the client.

I thought this because a couple of weeks ago I stumbled upon a
discussion where SSH (for some user) was creating a new connection for
each command sent to the server.  It was fixed by changing a server
setting so that SSH re-used connections.  At least that's how my
memory of the discussion.

Bernard

On Wed, Apr 15, 2009 at 4:23 AM, Sarah Reichelt
sarah.reich...@gmail.com wrote:
 While using libUrlFtpUploadFile to upload a bunch of files to a server, I
 find that libUrlFtpUploadFile opens a new socket for each upload. Even using
 a callback message to start a new one when the current one finishes, I get a
 max number of connections message back from the server when the server's
 max number is reached. After this, the next few upload attempts fail due to
 max number of connections; then as the open connections time out, new files
 can successfully upload again.

 I had this problem with a particular server. I always get the new
 connection with every command, but not all servers mind this.
 My solution was to use libURLSetFTPStopTime and set it to a very small
 number. This supposedly allows re-use of an existing connection, but
 in my experience all it does it keep one open while still opening
 another. If you set it to a very low number, then connections will
 close more rapidly, so you should not reach the maximum number of
 connections allowed.

 HTH,
 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: libUrlFtpUploadFile - reuse open sockets?

2009-04-15 Thread Jim Bufalini
Hi Sarah,

Rather than gambling and waiting for a timeout to occur and, assuming there
aren't any other sockets open for other purposes, couldn't Phil just issue a
resetAll in his uploadEnded command? This forces the close of all sockets
and a reset of everything in liburl. Otherwise, a close of the specific
socket used for the upload could be used, which socket could be determined
by checking the openSockets prior to and immediately after the
libUrlFtpUploadFile command.

I've never run into this limits problem personally but have used resetAll
and close socket.

Aloha from Hawaii,

Jim Bufalini

 I had this problem with a particular server. I always get the new
 connection with every command, but not all servers mind this.
 My solution was to use libURLSetFTPStopTime and set it to a very small
 number. This supposedly allows re-use of an existing connection, but
 in my experience all it does it keep one open while still opening
 another. If you set it to a very low number, then connections will
 close more rapidly, so you should not reach the maximum number of
 connections allowed.
 
 HTH,
 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


libUrlFtpUploadFile - reuse open sockets?

2009-04-14 Thread Phil Davis

Howdy -

While using libUrlFtpUploadFile to upload a bunch of files to a server, 
I find that libUrlFtpUploadFile opens a new socket for each upload. Even 
using a callback message to start a new one when the current one 
finishes, I get a max number of connections message back from the 
server when the server's max number is reached. After this, the next few 
upload attempts fail due to max number of connections; then as the open 
connections time out, new files can successfully upload again.


So... I want to know:

1) Does FTP require a new socket for each upload?

2) If not, how do I tell libUrlFtpUploadFile to reuse an existing open 
socket for the next upload?


3) Is there something else I'm missing? Am I making things more 
complicated than they need to be? I have a nagging suspicion along this 
line...



Here's how my code is structured:

on uploadMyFile pLocalFile, pServerPath
 libUrlFtpUploadFile pLocalFile,pServerPath,uploadEnded
end uploadMyFile

on uploadEnded pUrl, pStatus
 put pUrl  tab  pStatus  cr after fld callbackParams
 put nextFileFromList() into p1
 put nextServerPath() into p2
 send (uploadMyFile  p1  comma  p2) to me in 6 ticks
end uploadEnded


Many thanks for your help.
--
Phil Davis

PDS Labs
Professional Software Development
http://pdslabs.net

___
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: libUrlFtpUploadFile - reuse open sockets?

2009-04-14 Thread Jim Bufalini
Hi Phil,


 While using libUrlFtpUploadFile to upload a bunch of files to a server,
 I find that libUrlFtpUploadFile opens a new socket for each upload.
 Even
 using a callback message to start a new one when the current one
 finishes, I get a max number of connections message back from the
 server when the server's max number is reached. After this, the next
 few
 upload attempts fail due to max number of connections; then as the open
 connections time out, new files can successfully upload again.
 
 So... I want to know:
 
 1) Does FTP require a new socket for each upload?
 
 2) If not, how do I tell libUrlFtpUploadFile to reuse an existing open
 socket for the next upload?
 
 3) Is there something else I'm missing? Am I making things more
 complicated than they need to be? I have a nagging suspicion along this
 line...
 
 
 Here's how my code is structured:
 
 on uploadMyFile pLocalFile, pServerPath
   libUrlFtpUploadFile pLocalFile,pServerPath,uploadEnded
 end uploadMyFile
 
 on uploadEnded pUrl, pStatus
   put pUrl  tab  pStatus  cr after fld callbackParams
   put nextFileFromList() into p1
   put nextServerPath() into p2
   send (uploadMyFile  p1  comma  p2) to me in 6 ticks
 end uploadEnded
 

Since it doesn't appear that you are using the callback except to know the
upload ended and assuming these files are not huge and you don't need to do
anything else during the upload like show a progress bar or other
processing, you can just use:

Put binfile: before pLocalFile
Put URL pLocalFile into URL pServerPath

Unlike libUrlFtpUploadFile, a put URL is blocking, which means your
upLoadMyFile command is paused until the upload completes. If there is an
error, it will be returned in *the result* and you can handle your next
logic in the same handler.

I believe that because it's blocking, the socket is closed after the
upload, but someone else can/will correct me on this if I am wrong. ;-)

Aloha from Hawaii,

Jim Bufalini




___
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: libUrlFtpUploadFile - reuse open sockets?

2009-04-14 Thread Jim Ault
I think that using a callback handler you can detect the 100% complete  
message from the server,
then issue a 'QUIT' to close the connection immediately, then after  
getting the 'GOODBYE', start the next upload.


I have not done this in practice that I know of (accidents do happen  
and things work without you knowing why).


Jim Ault
Las Veagas
On Apr 14, 2009, at 3:34 PM, Phil Davis wrote:


Howdy -

While using libUrlFtpUploadFile to upload a bunch of files to a  
server, I find that libUrlFtpUploadFile opens a new socket for each  
upload. Even using a callback message to start a new one when the  
current one finishes, I get a max number of connections message  
back from the server when the server's max number is reached. After  
this, the next few upload attempts fail due to max number of  
connections; then as the open connections time out, new files can  
successfully upload again.


So... I want to know:

1) Does FTP require a new socket for each upload?

2) If not, how do I tell libUrlFtpUploadFile to reuse an existing  
open socket for the next upload?


3) Is there something else I'm missing? Am I making things more  
complicated than they need to be? I have a nagging suspicion along  
this line...



Here's how my code is structured:

on uploadMyFile pLocalFile, pServerPath
libUrlFtpUploadFile pLocalFile,pServerPath,uploadEnded
end uploadMyFile

on uploadEnded pUrl, pStatus
put pUrl  tab  pStatus  cr after fld callbackParams
put nextFileFromList() into p1
put nextServerPath() into p2
send (uploadMyFile  p1  comma  p2) to me in 6 ticks
end uploadEnded


Many thanks for your help.
--
Phil Davis

PDS Labs
Professional Software Development
http://pdslabs.net

___
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: libUrlFtpUploadFile - reuse open sockets?

2009-04-14 Thread Phil Davis

Hi Jim B  Jim A,

Thanks for the replies.

Actually I'm using libUrlFtpUploadFile because some of the files are 
movies (some  100mb), so I don't want to use a blocking command.


The more I think about this, the more I believe it's a libUrl bug. If 
socket reuse works for download (which I believe it does), it should 
work for upload... Of course my argument is from a desire for the beauty 
of symmetry without regard to what's possible - which is how many good 
things come into being  ;o)


I have a 2-part workaround:

on mouseUp
  ### WORKAROUND PART 1
  put 10 into xServerMax
  -- I know the above number from experience;
  -- would rather ask FTP server for max
  -- but don't know an FTP command for it
  libUrlSetFTPStopTime 1 -- set the socket timeout to 1 sec
  ### WORKAROUND PART1 - end

  uploadMyFile tFirstLocalFile, tFirstServerPath
end mouseUp


on uploadMyFile pLocalFile, pServerPath
  libUrlFtpUploadFile pLocalFile,pServerPath,uploadEnded
end uploadMyFile


on uploadEnded pUrl, pStatus
  put pUrl  tab  pStatus  cr after fld callbackParams
  put nextFileFromList() into p1
  put nextServerPath() into p2

  ### WORKAROUND PART 2
  repeat until (the number of lines in the openSockets  xServerMax)
 wait 1 tick with messages
  end repeat
  ### WORKAROUND PART 2 - end

  send (uploadMyFile  p1  comma  p2) to me in 1 ticks
end uploadEnded




Phil


Jim Bufalini wrote:

Hi Phil,

  

While using libUrlFtpUploadFile to upload a bunch of files to a server,
I find that libUrlFtpUploadFile opens a new socket for each upload.
Even
using a callback message to start a new one when the current one
finishes, I get a max number of connections message back from the
server when the server's max number is reached. After this, the next
few
upload attempts fail due to max number of connections; then as the open
connections time out, new files can successfully upload again.

So... I want to know:

1) Does FTP require a new socket for each upload?

2) If not, how do I tell libUrlFtpUploadFile to reuse an existing open
socket for the next upload?

3) Is there something else I'm missing? Am I making things more
complicated than they need to be? I have a nagging suspicion along this
line...


Here's how my code is structured:

on uploadMyFile pLocalFile, pServerPath
  libUrlFtpUploadFile pLocalFile,pServerPath,uploadEnded
end uploadMyFile

on uploadEnded pUrl, pStatus
  put pUrl  tab  pStatus  cr after fld callbackParams
  put nextFileFromList() into p1
  put nextServerPath() into p2
  send (uploadMyFile  p1  comma  p2) to me in 6 ticks
end uploadEnded




Since it doesn't appear that you are using the callback except to know the
upload ended and assuming these files are not huge and you don't need to do
anything else during the upload like show a progress bar or other
processing, you can just use:

Put binfile: before pLocalFile
Put URL pLocalFile into URL pServerPath

Unlike libUrlFtpUploadFile, a put URL is blocking, which means your
upLoadMyFile command is paused until the upload completes. If there is an
error, it will be returned in *the result* and you can handle your next
logic in the same handler.

I believe that because it's blocking, the socket is closed after the
upload, but someone else can/will correct me on this if I am wrong. ;-)

Aloha from Hawaii,

Jim Bufalini




___
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

  


--
Phil Davis

PDS Labs
Professional Software Development
http://pdslabs.net

___
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: libUrlFtpUploadFile - reuse open sockets?

2009-04-14 Thread Sarah Reichelt
 While using libUrlFtpUploadFile to upload a bunch of files to a server, I
 find that libUrlFtpUploadFile opens a new socket for each upload. Even using
 a callback message to start a new one when the current one finishes, I get a
 max number of connections message back from the server when the server's
 max number is reached. After this, the next few upload attempts fail due to
 max number of connections; then as the open connections time out, new files
 can successfully upload again.

I had this problem with a particular server. I always get the new
connection with every command, but not all servers mind this.
My solution was to use libURLSetFTPStopTime and set it to a very small
number. This supposedly allows re-use of an existing connection, but
in my experience all it does it keep one open while still opening
another. If you set it to a very low number, then connections will
close more rapidly, so you should not reach the maximum number of
connections allowed.

HTH,
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: libUrlFtpUploadFile - reuse open sockets?

2009-04-14 Thread Phil Davis

Thanks Sarah.

Sarah Reichelt wrote:

While using libUrlFtpUploadFile to upload a bunch of files to a server, I
find that libUrlFtpUploadFile opens a new socket for each upload. Even using
a callback message to start a new one when the current one finishes, I get a
max number of connections message back from the server when the server's
max number is reached. After this, the next few upload attempts fail due to
max number of connections; then as the open connections time out, new files
can successfully upload again.



I had this problem with a particular server. I always get the new
connection with every command, but not all servers mind this.
My solution was to use libURLSetFTPStopTime and set it to a very small
number. This supposedly allows re-use of an existing connection, but
in my experience all it does it keep one open while still opening
another. If you set it to a very low number, then connections will
close more rapidly, so you should not reach the maximum number of
connections allowed.

HTH,
Sarah
  

--
Phil Davis

PDS Labs
Professional Software Development
http://pdslabs.net

___
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


Reading from Sockets

2008-04-29 Thread rgould8

If I have a webpage that has a link like this:

a href=127.0.0.1:77Talk to Rev/a


and while that webpage in Safari has that link clicked, I'd like to have 
Revolution lurking in the background waiting for that click, can someone tell 
me what I'd need to add to this script?

on openCard
? open socket 127.0.0.1:77
? read from socket 127.0.0.1:77 with message gotdata
end openCard


on gotdata
? answer got data from the Safari webpage!
? close socket 127.0.0.1:77
end gotdata



I'm just a little confused about whether I need to _continually_ do the read 
socket in a timer-loop, or if I can give it an infinite timeout.
Right now, I don't get this to work at all, even when I click the link within 5 
seconds, so I'm obviously missing something important.? 




 

-Original Message-
From: Bill Marriott [EMAIL PROTECTED]
To: use-revolution@lists.runrev.com
Sent: Tue, 29 Apr 2008 8:33 am
Subject: Re: way to listen to port 127.0.0.1










You're on the right track.

If what you really need to do is to communicate with Rev from your web page, 
you could set up Revolution as a very simple web server on a *different* 
port -- Safari will use port 80 by default -- and send it a command in the 
form of a URL or POST command. You don't want to have the two applications 
(Safari and Rev) stepping on each other, trying to use the same port.

Andre Garzia's RevOnRockets has a basic web server implementation, but I 
don't know if you'd even need that fully-featured of a solution.

http://www.andregarzia.com/RevOnRockets/

 So, that puts me to Plan B:

 Since this is a touch-screen kiosk environment and I have full-control 
 over the hardware/software, I'd like to just use SAFT, which is software 
 that makes Safari run in full-screen mode, and then have a silent version 
 of Rev running in the background waiting for it's cue.? When it receives 
 the cue, it needs to print some data to a thermal-label printer attached 
 to the kiosk.

 I am was hoping that I could have a javascript on a web-page that passes 
 data to 127.0.0.1:80, and then have my Rev app ready to receive that data.

 I'm not suceeding, however, and I could use some assistance with the 
 scripting.?

 Something like:

 open socket 127.0.0.1:80
 read from socket 127.0.0.1:80 with message gotdata

 and then on the web-page:

 a href=127.0.0.1:80Click me to test sending a message to Revolution/a



___
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: Reading from Sockets

2008-04-29 Thread Jan Schenkel
--- [EMAIL PROTECTED] wrote:
 
 If I have a webpage that has a link like this:
 
 a href=127.0.0.1:77Talk to Rev/a
 
 
 and while that webpage in Safari has that link
 clicked, I'd like to have Revolution lurking in the
 background waiting for that click, can someone tell
 me what I'd need to add to this script?
 
 on openCard
 ? open socket 127.0.0.1:77
 ? read from socket 127.0.0.1:77 with message
 gotdata
 end openCard
 
 
 on gotdata
 ? answer got data from the Safari webpage!
 ? close socket 127.0.0.1:77
 end gotdata
 
 
 
 I'm just a little confused about whether I need to
 _continually_ do the read socket in a timer-loop,
 or if I can give it an infinite timeout.
 Right now, I don't get this to work at all, even
 when I click the link within 5 seconds, so I'm
 obviously missing something important.? 
 
 

You can find the old MetaCard HTTP server example at:
http://futura.disca.upv.es/~smm/public_xml/Software/MetaCard/metacard.com-mirror-2.5/mchttpd.zip

While it only supports the 'GET' method, it's a great
start for loearning how any socket-based server should
be built. RevOnRockets was inspired by it, as well as
several custom embedded web servers (I've built a few
myself)

Hope this helped,

Jan Schenkel.

Quartam Reports  PDF Library for Revolution
http://www.quartam.com

=
As we grow older, we grow both wiser and more foolish at the same time.  (La 
Rochefoucauld)


  

Be a better friend, newshound, and 
know-it-all with Yahoo! Mobile.  Try it now.  
http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ
___
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: Receiving data with Sockets when behind a Router

2007-02-02 Thread Derek Bump

Stephen Barncard wrote:
Look at IP tunnelling. This allows a computer on a LAN to get a port or 
range of ports of various protocols through a router from the outside 
world.


Stephen,

Thank you for the guidance!  I spent a little time this morning looking 
up IP Forwarding on the site you suggested as well as Wikipedia and a 
few others.  I'm still formulating how I handle this, but so far I'm 
assuming that handling IP Forwarding within Revolution can be achieved 
by simply using a port that is pre-registered with the Router?


If this is the case, and my program is designed to function behind most 
routers, I should probably go with a common (but appropriate) port. 
*Keeping my fingers crossed*



Derek Bump
Dreamscape Software
http://www.dreamscapesoftware.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: Receiving data with Sockets when behind a Router

2007-02-02 Thread Neal Campbell K3NC
Could it be as simple as your router does not have the right  
configuration to forward the port to your computer (or you have a  
firewall that prevents it since it thinks its from a non-trusted  
network?


Neal Campbell K3NC
[EMAIL PROTECTED]


Devoted to Dogs: How to be your dog's best owner
Great Dog Book  at www.abrohamneal.com



On Feb 2, 2007, at 12:33 AM, Derek Bump wrote:

I'm in need of some guidance.  How do you resolve an IP address  
when it's behind a router or a firewall?


I'm trying to build a simple communications device in Revolution,  
and I have been looking at some of the demo stacks that are out  
there.  They all work wonderfully, but I occasionally run into the  
problem of being behind a Wireless Router.


My IP address when connected through the router is 192.168.0.7,  
while the outside world see my IP as 69.179.91.117.  Attempting to  
connect to the public IP address results in nothing.


I mean I'm figuring with all the Instant Messengers and P2P  
programs out there that there's a way to do this.  Help!



Derek Bump
Dreamscape Software
http://www.dreamscapesoftware.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


___
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: Receiving data with Sockets when behind a Router

2007-02-02 Thread Jim Ault
The basic idea of a LAN behind a router is that the router assigns IP
addresses dynamically therefore each cpu can have a different IP address
every time it is booted.  Inexpensive routers can only forward one port to
one LAN IP address (internal network)  thus

using 9454 as the port number, for example

1  set a cpu firewall open for 2-way traffic on port 9454
2  set the router to forward incoming packets from the outside world on port
9454 to cpu at IP address 192.168.1.201 (this is a fixed setting by the
admin)
3  cpu at (201) address is running an app that tells the operating system to
open port 9454 on the cpu, then the app sends and receives on port 9454, and
at some point could close the port.

Rebooting the router or the computer can change the cpu's assigned address
of (201), thus forwarding is thwarted.  Network printers have to have their
router-assigned IP address fixed when installed, or they may not be
reachable.

Rebooting the router will not change the port forwarding.
Resetting the router will indeed clear the port forwarding.
The broadcasting source specifies a port number and the user must match that
port.
The broadcasting source specifies a computer address (IP address) which is
usually the static address of the router.  In the case of DSL service, I
believe each user is assigned a static IP address to make that system work.

This is based on my experience and may not be entirely correct.  This should
be accurate for most home or small office systems.

Hope this helps.

Jim Ault
Las Vegas


On 2/2/07 11:35 AM, Neal Campbell K3NC [EMAIL PROTECTED] wrote:

 Could it be as simple as your router does not have the right
 configuration to forward the port to your computer (or you have a
 firewall that prevents it since it thinks its from a non-trusted
 network?
 
 Neal Campbell K3NC
 [EMAIL PROTECTED]
 
 
 Devoted to Dogs: How to be your dog's best owner
 Great Dog Book  at www.abrohamneal.com
 
 
 
 On Feb 2, 2007, at 12:33 AM, Derek Bump wrote:
 
 I'm in need of some guidance.  How do you resolve an IP address
 when it's behind a router or a firewall?
 
 I'm trying to build a simple communications device in Revolution,
 and I have been looking at some of the demo stacks that are out
 there.  They all work wonderfully, but I occasionally run into the
 problem of being behind a Wireless Router.
 
 My IP address when connected through the router is 192.168.0.7,
 while the outside world see my IP as 69.179.91.117.  Attempting to
 connect to the public IP address results in nothing.
 
 I mean I'm figuring with all the Instant Messengers and P2P
 programs out there that there's a way to do this.  Help!
 
 
 Derek Bump
 Dreamscape Software
 http://www.dreamscapesoftware.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
 
 ___
 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: Receiving data with Sockets when behind a Router

2007-02-02 Thread Alex Tweedly

Stephen Barncard wrote:
Look at IP tunnelling. This allows a computer on a LAN to get a port 
or range of ports of various protocols through a router from the 
outside world.


All routers will have this.

http://www.linuxvirtualserver.org/VS-IPTunneling.html

Unfortunately, this scheme described here uses IP Tunnelling *direct* to 
the real server - and hence requires that the real server be directly 
addressable from the external Internet - which is not the case in the 
scenario of the original question.


There are also other problems that the article skates over 

1. This scheme has the real server send its reply direct to the client. 
This raises (or rather, doesn't raise :-) the question of what the form 
of these reply packets will be. There are two choices for the Source IP 
address


  - the real server's own IP address (the obvious choice). This can 
(will) result in the packets being dropped if the client is behind a 
secure NAT/firewall, because the src-ip of the packets will not match 
the dest-ip address of the established connection.
  - the Virtual IP address. This can (though only rarely will) result 
in the packets being dropped because they have spoofed IP addresses, and 
any ISP using Reverse Path Filtering will drop it for security reasons. 
Sadly, not enough ISPs run RPF (if they did, spam and other attacks 
would drop significantly), so you might get away with this.


2. the tunnelling is all the way to the server - so you need IP 
tunnelling support on the server, not on the router. Most users (i.e. 
Windows and Macs) will either not have this support, or will need 
privileged access to configure it.


3. MTU issues - probably not as serious now as they were a few years 
ago, since many people are configured with slightly smaller MTUs to 
allow use over VPN, but still might catch out some users.
then one can use dynDNS or other service to get the IP when it 
inevitably will change.


But knowing the new IP address on the server still leaves you vulnerable 
to the problem of changing the port forwarding on the router (and 
related issues, which Jim's email covers better than I could).


Note you could run this IP tunnelling via the router - having the router 
decapsulate the packet and forward to the relevant local machine (but 
that's no easier than configuring port forwarding, and not all routers 
will support GRE with configured output ports).


I'm in need of some guidance.  How do you resolve an IP address when 
it's behind a router or a firewall?


I'm trying to build a simple communications device in Revolution, and 
I have been looking at some of the demo stacks that are out there.  
They all work wonderfully, but I occasionally run into the problem of 
being behind a Wireless Router.


My IP address when connected through the router is 192.168.0.7, while 
the outside world see my IP as 69.179.91.117.  Attempting to connect 
to the public IP address results in nothing.


I mean I'm figuring with all the Instant Messengers and P2P programs 
out there that there's a way to do this.  Help!


Don't be confused by the term P2P. Many of these (e.g. BitTorrent) 
will function OK with only outbound connections, and the majority of 
users work this way. Those users who need (or want) higher speed access 
must either be not behind a NAT, or the use port forwarding to allow 
inbound connections.


One other hurdle to watch out for - even if you have port forwarding on 
the router, you also need to check for software firewall on the server 
machine; if the user is running one of these, it will need to have the 
relevant port opened up.


--

Alex Tweedly  mailto:[EMAIL PROTECTED]  www.tweedly.net

___
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: Receiving data with Sockets when behind a Router

2007-02-02 Thread Derek Bump

Neal Campbell K3NC wrote:
Could it be as simple as your router does not have the right 
configuration to forward the port to your computer (or you have a 
firewall that prevents it since it thinks its from a non-trusted network?


That very well could be.  I'm figuring that there will inevitably be 
some users out there who are behind an improperly configured router or 
firewall, but for the most part I would like to help to ensure that my 
program will be usable by any user.


I have been doing a little research and it appears that there is really 
nothing much that I can do to forward a port on my own, but instead I 
have to rely on the user figuring out how to do it on their own... which 
does not help me at all.


I do have one question (and please don't throw me to the wolves if I've 
proposed to break the network law), but where is the harm in my 
program utilizing a port that is most likely being forwarded?  If I 
utilize port 110 (POP3) behind a router, will the outside world still be 
able to communicate with me?  I'm not on a router right now so I can't 
try it out on my own.



Derek Bump
Dreamscape Software
http://www.dreamscapesoftware.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: Receiving data with Sockets when behind a Router

2007-02-02 Thread Derek Bump

Jim Ault wrote:

This is based on my experience and may not be entirely correct.  This should
be accurate for most home or small office systems.


Thanks Jim, your information does help.  Ultimately the program I'm 
developing will fail simply because the target audience is not technical 
enough to even understand how to forward a port, nor do they even 
understand what a Port is.



Derek Bump
Dreamscape Software
http://www.dreamscapesoftware.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: Receiving data with Sockets when behind a Router

2007-02-02 Thread Derek Bump
So I have an idea to help resolve the issue of port forwarding.  I did 
some testing with a friend overseas (Japan) and my computer (USA).  He's 
behind a router and I am not, but it's apparent that his router supports 
Port Triggering.  I know this because the Port that his computer 
supplied to me during the socket connection (that he initiated) was like 
324 or 243.


The model of my program is that of a program that acts as a client and 
server, and occasionally updates it's information with a central server. 
 So could I do this to overcome the Port Forwarding issue:


  1. Client A opens a socket to the Primary Server.

  2. Primary Server stores the IP Address  Port.

  3. Client B gets Client A's IP Address  Port from the Primary Server.

  4. Client B opens a socket to Client A with the IP Address  Port 
that it just received.



Would this work?  The reason Client A connects to the Primary Server is 
because Client B has no idea what the IP of Client A is, and I want to 
eliminate the need for Static IP's and services for such.



Derek Bump
Dreamscape Software
http://www.dreamscapesoftware.com/



Derek Bump wrote:
I'm in need of some guidance.  How do you resolve an IP address when 
it's behind a router or a firewall?


I'm trying to build a simple communications device in Revolution, and I 
have been looking at some of the demo stacks that are out there.  They 
all work wonderfully, but I occasionally run into the problem of being 
behind a Wireless Router.


My IP address when connected through the router is 192.168.0.7, while 
the outside world see my IP as 69.179.91.117.  Attempting to connect to 
the public IP address results in nothing.


I mean I'm figuring with all the Instant Messengers and P2P programs out 
there that there's a way to do this.  Help!



Derek Bump
Dreamscape Software
http://www.dreamscapesoftware.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




___
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


Receiving data with Sockets when behind a Router

2007-02-01 Thread Derek Bump
I'm in need of some guidance.  How do you resolve an IP address when 
it's behind a router or a firewall?


I'm trying to build a simple communications device in Revolution, and I 
have been looking at some of the demo stacks that are out there.  They 
all work wonderfully, but I occasionally run into the problem of being 
behind a Wireless Router.


My IP address when connected through the router is 192.168.0.7, while 
the outside world see my IP as 69.179.91.117.  Attempting to connect to 
the public IP address results in nothing.


I mean I'm figuring with all the Instant Messengers and P2P programs out 
there that there's a way to do this.  Help!



Derek Bump
Dreamscape Software
http://www.dreamscapesoftware.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: Receiving data with Sockets when behind a Router

2007-02-01 Thread Stephen Barncard
Look at IP tunnelling. This allows a computer on a LAN to get a port 
or range of ports of various protocols through a router from the 
outside world.


All routers will have this.

http://www.linuxvirtualserver.org/VS-IPTunneling.html

then one can use dynDNS or other service to get the IP when it 
inevitably will change.


sqb


I'm in need of some guidance.  How do you resolve an IP address when 
it's behind a router or a firewall?


I'm trying to build a simple communications device in Revolution, 
and I have been looking at some of the demo stacks that are out 
there.  They all work wonderfully, but I occasionally run into the 
problem of being behind a Wireless Router.


My IP address when connected through the router is 192.168.0.7, 
while the outside world see my IP as 69.179.91.117.  Attempting to 
connect to the public IP address results in nothing.


I mean I'm figuring with all the Instant Messengers and P2P programs 
out there that there's a way to do this.  Help!



Derek Bump
Dreamscape Software
http://www.dreamscapesoftware.com/



--


stephen barncard
s a n  f r a n c i s c o
- - -  - - - - - - - - -



___
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: rev sockets driven apps...

2006-03-24 Thread Pierre Sahores

Hi Troy,

Le 23 mars 06 à 03:26, Troy Rollins a écrit :



On Mar 15, 2006, at 4:41 PM, Pierre Sahores wrote:


Gohead and don't hesite about more details, if that can help ;-)


Perhaps could you have a look at this link and binded example app
material : it's a short resume of the way i'm running Rev TCP
sockets application's servers under Linux and OSX since 1998. Don't
hesite to ask for more closely explaintions.

http://istream.homeunix.com/insead/index_en.html


Hi Pierre,

I've finally had a chance to review the documents above. That is  
very cool stuff, but leaves me wondering... if what I want is a  
socket server, why do I need apache and php? I don't have any need  
of web pages or html, strictly socket communications. Is there some  
other advantage that I am missing, or are we really talking about  
two different things?


Yes ;)

Because Apache, PHP or PostgreSQL are natively working in  
multiprocessing mode, any time you stick a Rev application in betwin  
them, this Rev app will be coached by those three other components  
in multiprocess mode even if Rev (monoprocess able only) will not  
have to deal by it-self about multiprocessing. In practice, Rev just  
have to care about replying to the Apache-PHP requests it receive and  
the queries order is fully managed by Apache-PHP when Rev is acting  
as the httpd client app and by PostgreSQL when Rev is acting as the  
PostgreSQL application server app.


The main advantage is that this way make us sure that Rev has just to  
do its own job (run transcript code) without having to manage any  
multiprocessing or multithreading queue tasks. On both sides of the  
Rev app, Apache-PHP and the SQL deamon are full handling this for Rev.


So, even if you just want to use Rev to run text containts (instead  
of html) trough TCP sockets, it's always a rock-solid solution to  
have Apache running in front in your Rev server.


Second : with the PHP sockets listener running in betwin Apache and  
Rev, the socket translation betwin Apache:80 and Rev:what you  
want is always a very good solution to make sure that your Rev app  
is 100% unbindable from the intenet outside world. Only Apache is  
authorised to speak to it : in about the task of the security of your  
n-tier app, this can realy do matter...


Best,


Thanks.

--
Troy
RPSystems, Ltd.
http://www.rpsystems.net





--
Pierre Sahores
www.sahores-conseil.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

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


Sockets

2005-12-11 Thread Jim Hurley
I'm learning something about testing for an Internet connection from 
the last couple of posts of the list digest.


I used to use the old method of testing for a connection to Google. 
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.


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-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: What gives with Sockets?

2005-06-15 Thread Björnke von Gierke

What port are you using?
All ports below a certain threshold need root access on mac os x and 
win nt upwards...



On Jun 15 2005, at 04:47, Thomas McCarthy wrote:



Hi, builiding a simple server and client. Simple stuff--open a port on 
the server and listen. Write to the server from the client.


I had it working at home (mac OS 8.6 and win98). then I brought it to 
work (OSX and NT4) no good. It failed both ways (mac as server/win 
client and vice versa) This shouldn't be rocket science.


I did something like this about 4 years ago in MetaCard and vaguely 
remember pulling out some hairs then, too.


could there be some Ethernet-hub thing going on? I think I've got the 
addresses all right. Ar!


tom

___
Join Excite! - http://www.excite.com
The most personalized portal on the Web!


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




--

http://contest.wecode.org
Now running: the first ChatRev coding contest!
sponsors:
Altuit
Andre Garzia
Karl Becker
Runtime Revolution
TidBITS in cooperation with eHUG

___
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


What gives with Sockets?

2005-06-14 Thread Thomas McCarthy

Hi, builiding a simple server and client. Simple stuff--open a port on the 
server and listen. Write to the server from the client.

I had it working at home (mac OS 8.6 and win98). then I brought it to work (OSX 
and NT4) no good. It failed both ways (mac as server/win client and vice versa) 
This shouldn't be rocket science.

I did something like this about 4 years ago in MetaCard and vaguely remember 
pulling out some hairs then, too.

could there be some Ethernet-hub thing going on? I think I've got the addresses 
all right. Ar!

tom

___
Join Excite! - http://www.excite.com
The most personalized portal on the Web!


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


Rev, sockets, IP Multicast Part II

2005-04-02 Thread Alex Tweedly
In part one, I briefly explained one reason why it would be native to 
have support for IP multicast in Rev - it provides very clean, easy 
solutions for certain types of problems.

But how can we use IP Multicast when Rev doesn't support it ?
[Remember - we can send multicast packets - it's only receiving them 
that is unsupported.]

First obvious answer is to submit a Bugzilla request for multicast 
support - but quite honestly I don't see it as being a top priority for 
RR to do. Even as a multicast enthusiast and advocate, I can't see 
adding this feature as a high priority for RunRev.

Second obvious solution is to write an external - but that sounds hard; 
I've barely written my first trivial external, and this one would need 
to generate asynchronous callbacks, etc.  - so I decided it was the 
wrong thing to try for my first real external.

Then the recent discussion about the possibility of solving a problem 
using multiple tools, with sockets to communicate between them gave me 
the third obvious solution.

I've now written a multicast bridge - a program which can be run as a 
server, accepts commands (on a UDP socket) to listen to a multicast 
group/port, and forwards everything each packet it receives to a 
specified UDP unicast port. You'd need only a single copy of this 
running on each machine - and any or all Rev apps which wanted to 
receive multicast packets could make use of it. I wrote this in Python - 
though it could easily be translated to C or C++ - but life really is 
too short for that; the Python version works just fine, and will handle 
reasonable packet rates.

The application (in Rev, or any other language without native multicast 
support) sends commands to the bridge requesting that any packets it 
(the bridge) receives on a particular IP multicast group / port 
combination should be forwarded to the (unicast) IP address / port 
specified by the app.  Normally, the app and bridge should be on the 
same machine - in fact, the default mode in the bridge is to only 
allow this case.

Caveats:
1. IP Multicast is not universally supported on networks - so check that 
it is available everywhere you need it before committing to using it in 
a project.

2. The multicast bridge is a potential security hole if used 
carelessly - keep to the default Secure mode or if you need the 
flexibility. implement some real security such as md5 shared secrets 
(this is pretty simple - if you want to do it, let me know and I'll post 
the extended version of the bridge code and client stack).

I'll try to post the sample client stack to RevOnline (as soon as I 
figure out how to do that without overwriting one of my existing 
stacks). I can't post the Python code for the multicast bridge there - 
so it is available from my web site, as is the Rev stack.

The bridge code is at www.tweedly.net/RunRev/mcast-bridge.pyt
A very simple python test program is at 
www.tweedly.net/RunRev/mcast-client.pyt
A similarly simple test stack is at www.tweedly.net/RunRev/mcastclient.rev

If you've never used Python - download a (free) copy (www.python.org), 
it's easy enough to use.

Feel free to email me (on- or off-list) if you run into any problems, or 
have any questions.

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

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


Re: Rev, sockets, IP Multicast Part II

2005-04-02 Thread Dar Scott
On Apr 2, 2005, at 12:17 PM, Alex Tweedly wrote:
But how can we use IP Multicast when Rev doesn't support it ?
I have a vague memory of the other Alex writing an external.
I have made a mock multicast using UDP.
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: Rev, sockets, IP Multicast.

2005-03-31 Thread Pierre Sahores
Woooaw ! What an usefull post, you share with all of us ! Many thanks 
for that, Alex. I'm waiting for reading your next posts with great 
interest :-)

All the best,
Le 31 mars 05, à 03:16, Alex Tweedly a écrit :
A while ago (around 2nd March), in a thread about UDP sockets, I 
bemoaned the fact that Rev didn't allow for receiving IP multicast 
packets.

About the same time (around 9th March), Richard Miller asked for 
suggestions on how to tackle his problem for client status reporting 
and monitoring. Various solutions were suggested - but at the time, I 
thought how much easier the problem would be if multicast was 
supported; and it kept bothering me. This is the result.

In a subsequent email, I'll describe what I've been doing to make it 
possible to use IP Multicast from Rev. But first, a quick reminder of 
Richard's problem description, and then the simplest multicast 
solution (to show just how simple this problem would be if we did have 
multicast available).

Problem Statement.
There are a number (on the order of 100) clients, which need to report 
their status (status being things like - online, offline, back 
shortly, ).They will update their status relatively frequently 
(say every 30 seconds). We have available a dedicated server to 
collect these status reports, and to send the collected status report 
to the monitors. There are a similar number of monitors (~100), and 
each monitor wants to get the status info for all clients, again 
roughly every 30 seconds.

IP Multicast solution.
Use UDP sockets over IP multicast; each client sends its status report 
to the multicast group every 30 seconds, each monitor listens to the 
multicast group and so receives all the status reports.

(All variable beginning with g are assumed to be global, and to have 
the values we need in them )

CLIENT CODE
initialization:
 open datagram socket to 225.1.1.1:5678   -- no need for a callback 
handler
 send every30secs to me

timed event:
on every30secs
   write gMyName  comma  gMystatus to socket 225.1.1.1:5678
   send every30secs to me in 30 seconds
end every30secs
SERVER:  There is  no server needed.
MONITOR
Each monitor listens to the multicast group.
MONITOR CODE:
initialization
  listen to multicast group 225.1.1.1-- if only we could do this 
in Rev !!!
  accept datagram connections on port 5678 with message gotStatusReport

on gotStatusReport  p, pData
  put item 1 of pData into tName
  put seconds()  comma   pData into gStatus[tName]
end gotStatusReport
to get status of a user / machine
function getStatus pName
   if item 1 of gStatus[pName] - seconds()  75 then return timed 
outreturn item 3 to -1 of gStatus[tName]
end getStatus

There now, couldn't be much easier - could it ?
Note that before using this for real, we would want to add a little 
bit of security to protect against impostor clients - but that's only 
the same protection as we'd want in any other solution.

FAQ:
1. What is this IP multicast ?
A mechanism where a single transmitted packet can be received by any 
number of machines that want to hear it. There are a number of 
introductions to IP multicast around, better than I would write here. 
One example is http://www.tldp.org/HOWTO/Multicast-HOWTO-1.html
but many others can be found via Google ...

2. Isn't UDP unreliable ? What if packets get lost ?  Or are delivered 
out of order ?
Yes. It will be OK - from the problem definition, it is clear that the 
monitor does not require to have the absolutely current status of the 
client - it can lag behind by up to 30+30 seconds. In this solution, 
the client repeats its status report  frequently, so if a packet gets 
lost on the way to one (or more) monitors, that monitor's view of the 
client's status will lag behind for one additional time period.  It's 
possible we'd want to change the client reporting period from 30 secs 
to maybe 20. We might also want to adjust the 75 seconds - the time 
at which we decide that it's been so long since we heard from a 
particular client that we wish to assume it is dead or disconnected - 
down to maybe 50 secs.

Since every transaction in our protocol is a single packet being sent 
one way, we will not get out of order packets unless the network is 
delaying some packets by 30 (or 20) seconds, while allowing others 
through. If your network delivers packets out of order by tens of 
seconds, you will have so many other problems, you won't notice this 
one :-)

3. Sounds good - but how can we use IP multicast from Rev ?
This is only the teaser - I'll give my (current) solution to that in 
tomorrow's email - this is just to whet your appetite.
(And also to provide me with a deadline so I will complete the other 
email :-)

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

--
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.308 / Virus Database: 266.8.4 - Release Date: 27/03/2005
___
use-revolution mailing list
use

Rev, sockets, IP Multicast.

2005-03-30 Thread Alex Tweedly
A while ago (around 2nd March), in a thread about UDP sockets, I 
bemoaned the fact that Rev didn't allow for receiving IP multicast packets.

About the same time (around 9th March), Richard Miller asked for 
suggestions on how to tackle his problem for client status reporting and 
monitoring. Various solutions were suggested - but at the time, I 
thought how much easier the problem would be if multicast was supported; 
and it kept bothering me. This is the result.

In a subsequent email, I'll describe what I've been doing to make it 
possible to use IP Multicast from Rev. But first, a quick reminder of 
Richard's problem description, and then the simplest multicast solution 
(to show just how simple this problem would be if we did have multicast 
available).

Problem Statement.
There are a number (on the order of 100) clients, which need to report 
their status (status being things like - online, offline, back shortly, 
).They will update their status relatively frequently (say every 30 
seconds). We have available a dedicated server to collect these status 
reports, and to send the collected status report to the monitors. 
There are a similar number of monitors (~100), and each monitor wants to 
get the status info for all clients, again roughly every 30 seconds.

IP Multicast solution.
Use UDP sockets over IP multicast; each client sends its status report 
to the multicast group every 30 seconds, each monitor listens to the 
multicast group and so receives all the status reports.

(All variable beginning with g are assumed to be global, and to have 
the values we need in them )

CLIENT CODE
initialization:
 open datagram socket to 225.1.1.1:5678   -- no need for a callback 
handler
 send every30secs to me

timed event:
on every30secs
   write gMyName  comma  gMystatus to socket 225.1.1.1:5678
   send every30secs to me in 30 seconds
end every30secs
SERVER:  There is  no server needed.
MONITOR
Each monitor listens to the multicast group.
MONITOR CODE:
initialization
  listen to multicast group 225.1.1.1-- if only we could do this 
in Rev !!!
  accept datagram connections on port 5678 with message gotStatusReport

on gotStatusReport  p, pData
  put item 1 of pData into tName
  put seconds()  comma   pData into gStatus[tName]
end gotStatusReport
to get status of a user / machine
function getStatus pName
   if item 1 of gStatus[pName] - seconds()  75 then return timed out 
   return item 3 to -1 of gStatus[tName]
end getStatus

There now, couldn't be much easier - could it ?
Note that before using this for real, we would want to add a little bit 
of security to protect against impostor clients - but that's only the 
same protection as we'd want in any other solution.

FAQ:
1. What is this IP multicast ?
A mechanism where a single transmitted packet can be received by any 
number of machines that want to hear it. There are a number of 
introductions to IP multicast around, better than I would write here. 
One example is http://www.tldp.org/HOWTO/Multicast-HOWTO-1.html
but many others can be found via Google ...

2. Isn't UDP unreliable ? What if packets get lost ?  Or are delivered 
out of order ?
Yes. It will be OK - from the problem definition, it is clear that the 
monitor does not require to have the absolutely current status of the 
client - it can lag behind by up to 30+30 seconds. In this solution, the 
client repeats its status report  frequently, so if a packet gets lost 
on the way to one (or more) monitors, that monitor's view of the 
client's status will lag behind for one additional time period.  It's 
possible we'd want to change the client reporting period from 30 secs to 
maybe 20. We might also want to adjust the 75 seconds - the time at 
which we decide that it's been so long since we heard from a particular 
client that we wish to assume it is dead or disconnected - down to maybe 
50 secs.

Since every transaction in our protocol is a single packet being sent 
one way, we will not get out of order packets unless the network is 
delaying some packets by 30 (or 20) seconds, while allowing others 
through. If your network delivers packets out of order by tens of 
seconds, you will have so many other problems, you won't notice this one :-)

3. Sounds good - but how can we use IP multicast from Rev ?
This is only the teaser - I'll give my (current) solution to that in 
tomorrow's email - this is just to whet your appetite.
(And also to provide me with a deadline so I will complete the other 
email :-)

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

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


Re: RunRev and sockets.

2005-03-23 Thread Mark Wieder
Keith-

Tuesday, March 22, 2005, 4:35:53 PM, you wrote:

KH Did you have hassles with MSAccess handling dead tcpip connections?

Dead in what way? I can certainly catch sockets that aren't open.
Timeouts may be a problem, but this hasn't come up for me yet. I'm
using Access as a client for a runrev server app, and timeouts
shouldn't happen unless the server disappears after a client request
and before the server response. Sockets are a pain to use in basic,
though.

-- 
-Mark Wieder
 [EMAIL PROTECTED]

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


RunRev and sockets.

2005-03-22 Thread Keith Hutchison
Hi Mark,

 KH I am really interested in exploring the idea of having RunRev stacks
talking
 KH to RealBasic compiled apps, via tcpip.

 Shouldn't be a problem. I've got runrev stacks talking with MSAccess
 apps over sockets.

Did you have hassles with MSAccess handling dead tcpip connections?

Keith Hutchison
Balance-Infosystems.Com

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

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


Re: Opening Sockets on localhost

2005-03-20 Thread Till Bandi
so Dan, don't forget, that is one of the subjects we are waiting for 
good explanations from someone that can well explain (and some of us - 
I think - even already paid for it?)  ;-)

Till
Am 16.03.2005 um 12:13 schrieb Alex Tweedly:
Dan Shafer wrote:
Alex.
I got it. IOW, opening a socket doesn't work unilaterally. The 
server has to have a listener on that port first. Right?
Right. When you open a TCP socket  (i.e. open socket to host:port), 
a TCP connection is formed. A packet is sent from your machine's TCP 
stack to his, and he sends a reply (assuming some application has done 
accept connection on the correct port). If there is no-one listening 
on that port, the remote machine will either ignore the incoming 
packet, or send back a reject packet.

When (if) your host receives a positive acknowledgment, then the 
connection is successful (from your point of view); your TCP stack 
then sends him back a third packet - and only when he receives it does 
he consider the connection complete.  (He can't consider it complete 
until then, because there could be a problem getting his packets to 
you - the only way he knows that has succeeded is when you reply).  
You may hear this referred to as TCP's three-way handshake.

Note that when you open a UDP socket (i.e. open datagram socket to 
host:port), things are completely different. UDP (datagram) is 
connectionless, so the open socket does not cause any network 
activity, and will generally succeed provided the host:port have 
valid values.

I'm going to figure out this server stuff one of these days.
And once you do, you'll realize how simple it all was to begin with, 
and wonder why no-one ever wrote a decent explanation of it in the 
first place. It's because most of us can't write decent explanations 
of anything :-)

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

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


Re: Opening Sockets on localhost

2005-03-20 Thread Mikey
Also, socket behavior is generally well-understood and well-explained
elsewhere on
the net.

Don't forget, if your're using a packet sniffer and examining the
traffic you're sending to yourself you won't see anything on Windows. 
That's because on Windows if the traffic doesn't hit the NIC the
sniffers can't see it.


-- 
On the first day, God created the heavens and the Earth
On the second day, God created the oceans.
On the third day, God put the animals on hold for a few hours,
   and did a little diving.
And God said, This is good.
___
use-revolution mailing list
use-revolution@lists.runrev.com
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: Opening Sockets on localhost

2005-03-16 Thread Alex Tweedly
Dan Shafer wrote:
Alex.
I got it. IOW, opening a socket doesn't work unilaterally. The 
server has to have a listener on that port first. Right?
Right. When you open a TCP socket  (i.e. open socket to host:port), a 
TCP connection is formed. A packet is sent from your machine's TCP stack 
to his, and he sends a reply (assuming some application has done accept 
connection on the correct port). If there is no-one listening on that 
port, the remote machine will either ignore the incoming packet, or send 
back a reject packet.

When (if) your host receives a positive acknowledgment, then the 
connection is successful (from your point of view); your TCP stack then 
sends him back a third packet - and only when he receives it does he 
consider the connection complete.  (He can't consider it complete until 
then, because there could be a problem getting his packets to you - the 
only way he knows that has succeeded is when you reply).  You may hear 
this referred to as TCP's three-way handshake.

Note that when you open a UDP socket (i.e. open datagram socket to 
host:port), things are completely different. UDP (datagram) is 
connectionless, so the open socket does not cause any network 
activity, and will generally succeed provided the host:port have valid 
values.

I'm going to figure out this server stuff one of these days.
And once you do, you'll realize how simple it all was to begin with, and 
wonder why no-one ever wrote a decent explanation of it in the first 
place. It's because most of us can't write decent explanations of 
anything :-)

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

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


Re: Using sockets

2005-03-15 Thread Mark Smith
Kevin, note that I create a new variable 'nVar' in the loop, so you 
shouldn't be doubling anything up.
My repeat loop obviously assumes that the extra char is at the 
beginning of every line, not just some of them.

An alternative would be to use the replace function, as others have 
noted, but if you don't know what the square is, then you'd have to 
find out, which you could do by pasting one of them from your field 
into this line in the message box:

put charToNum(paste the char here) - remember to put the character in 
quotes
This will give you a number which you can then use:

replace numToChar(the number you got) with empty in tVar
Cheers,
Mark
On 15 Mar 2005, at 02:45, Kevin J wrote:
Not only that it repeats the entire page but it does get rid of he box
thing the second time around.
On Mon, 14 Mar 2005 19:36:00 -0500, Frank D. Engel, Jr.
[EMAIL PROTECTED] wrote:
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
Won't that delete the first character you retrieve?
On Mar 14, 2005, at 7:08 PM, Mark Smith wrote:
on mouseUp
  open socket theseahaven.com:5500
  read from socket theseahaven.com:5500 for -1
  put it into tvar
  repeat for each line L in tVar
put char 2 to -1 of L  cr after nVar
  end repeat
  delete last char of nVar --- clear trailing cr
  put nVar in to field 1
end mouseUp
___
use-revolution mailing list
use-revolution@lists.runrev.com
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: Opening Sockets on localhost

2005-03-15 Thread Alex Tweedly
Dan Shafer wrote:
If I open socket to localhost and look at the result, it's empty, 
which means the socket got created. If I subsequently use close socket 
localhost, that works, too. If, before I close the socket I try to 
open it again, I get the expected error indicating the socket is 
already open. So far, so good.

However, if I append a port to the open socket command, nothing 
happens. open socket to localhost:8080 followed immediately by cloe 
socket localhost:8080 returns socket is not open.

OS X 10.3.8, Rev 2.5.1.
Is this broken or am I misunderstanding something or...???
Possibly neither.
open socket localhost  is equivalent toopen socket localhost:80
the default port is 80, which is generally used for HTTP connections.  
This should succeed if your machine is able (willing) to accept http 
connections, and otherwise it should fail.  Sounds like it succeeds on 
your machine.

open socket localhost:8080should fail, unless you have some 
process on your machine accepting connections on port 8080 - fairly 
unlikely, so I'd expect it to fail.

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

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


Re: Opening Sockets on localhost

2005-03-15 Thread Dan Shafer
Alex.
I got it. IOW, opening a socket doesn't work unilaterally. The server 
has to have a listener on that port first. Right?

I'm going to figure out this server stuff one of these days.
Dan
On Mar 15, 2005, at 5:05 PM, Alex Tweedly wrote:
Dan Shafer wrote:
If I open socket to localhost and look at the result, it's empty, 
which means the socket got created. If I subsequently use close 
socket localhost, that works, too. If, before I close the socket I 
try to open it again, I get the expected error indicating the socket 
is already open. So far, so good.

However, if I append a port to the open socket command, nothing 
happens. open socket to localhost:8080 followed immediately by 
cloe socket localhost:8080 returns socket is not open.

OS X 10.3.8, Rev 2.5.1.
Is this broken or am I misunderstanding something or...???
Possibly neither.
open socket localhost  is equivalent toopen socket 
localhost:80
the default port is 80, which is generally used for HTTP connections.  
This should succeed if your machine is able (willing) to accept http 
connections, and otherwise it should fail.  Sounds like it succeeds on 
your machine.

open socket localhost:8080should fail, unless you have some 
process on your machine accepting connections on port 8080 - fairly 
unlikely, so I'd expect it to fail.

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

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


Using sockets

2005-03-14 Thread Kevin J
Well I have taken a break from working on my text editor. So I decided
to play around with the socket functions. I was trying to open a
socket to a text game so that I could read the login page I can get it
in to the text field and the page will show up in the field but it
will have a little square box at the left hand side of the field on
every line. How would I get rid of that? This is what I did to connect
to the socket

on mouseUp
  open socket theseahaven.com:5500
  read from socket theseahaven.com:5500 for -1
  put it into tvar
  put tvar into fieldfield1
end mouseUp
___
use-revolution mailing list
use-revolution@lists.runrev.com
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: Using sockets

2005-03-14 Thread Dar Scott
On Mar 14, 2005, at 1:01 PM, Kevin J wrote:
I was trying to open a
socket to a text game so that I could read the login page I can get it
in to the text field and the page will show up in the field but it
will have a little square box at the left hand side of the field on
every line. How would I get rid of that?
The game might be using lf cr at the end of each line.  ASCII CR is 
numToChar(13); get rid of those.

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: Using sockets

2005-03-14 Thread Mark Wieder
Kevin-

Monday, March 14, 2005, 12:01:47 PM, you wrote:

KJ Well I have taken a break from working on my text editor. So I decided
KJ to play around with the socket functions. I was trying to open a
KJ socket to a text game so that I could read the login page I can get it
KJ in to the text field and the page will show up in the field but it
KJ will have a little square box at the left hand side of the field on
KJ every line. How would I get rid of that? This is what I did to connect
KJ to the socket

KJ on mouseUp
KJ   open socket theseahaven.com:5500
KJ   read from socket theseahaven.com:5500 for -1
KJ   put it into tvar
KJ   put tvar into fieldfield1
KJ end mouseUp

You're seeing crlf conversion problems. Runrev uses linefeeds as line
delimiters and you're probably seeing crlf pairs coming over the line.
You might try the replace command on the incoming stream to

replace crlf with lf in tvar

-- 
-Mark Wieder
 [EMAIL PROTECTED]

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


Re: Using sockets

2005-03-14 Thread Mark Smith
On 14 Mar 2005, at 20:15, Kevin J wrote:
Well I have taken a break from working on my text editor. So I decided
to play around with the socket functions. I was trying to open a
socket to a text game so that I could read the login page I can get it
in to the text field and the page will show up in the field but it
will have a little square box at the left hand side of the field on
every line. How would I get rid of that? This is what I did to connect
to the socket


I think the little square is an ASCII number that doesn't actually have 
a corresponding alpha numeric character. When getting data from 
different systems that have different line delimiters and such-like, 
you get this sort of thing. Probably the easiest solution would be to 
insert a loop to remove them after put it into tVar:

on mouseUp
  open socket theseahaven.com:5500
  read from socket theseahaven.com:5500 for -1
  put it into tvar
  repeat for each line L in tVar
put char 2 to -1 of L  cr after nVar
  end repeat
  delete last char of nVar --- clear trailing cr
  put nVar in to field 1
end mouseUp 
___
use-revolution mailing list
use-revolution@lists.runrev.com
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: Using sockets

2005-03-14 Thread Frank D. Engel, Jr.
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
Won't that delete the first character you retrieve?
On Mar 14, 2005, at 7:08 PM, Mark Smith wrote:
on mouseUp
  open socket theseahaven.com:5500
  read from socket theseahaven.com:5500 for -1
  put it into tvar
  repeat for each line L in tVar
put char 2 to -1 of L  cr after nVar
  end repeat
  delete last char of nVar --- clear trailing cr
  put nVar in to field 1
end mouseUp
- ---
Frank D. Engel, Jr.  [EMAIL PROTECTED]
$ ln -s /usr/share/kjvbible /usr/manual
$ true | cat /usr/manual | grep John 3:16
John 3:16 For God so loved the world, that he gave his only begotten 
Son, that whosoever believeth in him should not perish, but have 
everlasting life.
$
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.2.4 (Darwin)

iD8DBQFCNi3w7aqtWrR9cZoRAhEoAJ9hfH94f7agikO70ow2Id2erXmYbACdHGdn
gvWFlnMqorwXqVOlBMcMqpc=
=zKT5
-END PGP SIGNATURE-

___
$0 Web Hosting with up to 120MB web space, 1000 MB Transfer
10 Personalized POP and Web E-mail Accounts, and much more.
Signup at www.doteasy.com
___
use-revolution mailing list
use-revolution@lists.runrev.com
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: Using sockets

2005-03-14 Thread Kevin J
Not only that it repeats the entire page but it does get rid of he box
thing the second time around.


On Mon, 14 Mar 2005 19:36:00 -0500, Frank D. Engel, Jr.
[EMAIL PROTECTED] wrote:
 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1
 
 Won't that delete the first character you retrieve?
 
 On Mar 14, 2005, at 7:08 PM, Mark Smith wrote:
 
  on mouseUp
open socket theseahaven.com:5500
read from socket theseahaven.com:5500 for -1
put it into tvar
repeat for each line L in tVar
  put char 2 to -1 of L  cr after nVar
end repeat
delete last char of nVar --- clear trailing cr
put nVar in to field 1
  end mouseUp
 
 - ---
 Frank D. Engel, Jr.  [EMAIL PROTECTED]
 
 $ ln -s /usr/share/kjvbible /usr/manual
 $ true | cat /usr/manual | grep John 3:16
 John 3:16 For God so loved the world, that he gave his only begotten
 Son, that whosoever believeth in him should not perish, but have
 everlasting life.
 $
 -BEGIN PGP SIGNATURE-
 Version: GnuPG v1.2.4 (Darwin)
 
 iD8DBQFCNi3w7aqtWrR9cZoRAhEoAJ9hfH94f7agikO70ow2Id2erXmYbACdHGdn
 gvWFlnMqorwXqVOlBMcMqpc=
 =zKT5
 -END PGP SIGNATURE-
 
 ___
 $0 Web Hosting with up to 120MB web space, 1000 MB Transfer
 10 Personalized POP and Web E-mail Accounts, and much more.
 Signup at www.doteasy.com
 
 ___
 use-revolution mailing list
 use-revolution@lists.runrev.com
 http://lists.runrev.com/mailman/listinfo/use-revolution

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


Re: UDP sockets - again

2005-03-02 Thread Mark Wieder
Alex-

Tuesday, March 1, 2005, 5:17:54 PM, you wrote:

AT There are a few other circumstances where you might want to choose UDP
AT rather than TCP, apart from the speed and low overhead cases.

Thanks. I wasn't aware that VOIP used UDP.

AT (And unfortunately, Rev doesn't support either multicast or PGM).
AT (Actually, I think Rev doesn't fully handle broadcast - I can get it to
AT send to a local-broadcast address and they are received by other devices
AT - but I can't get Rev to receive them ... will experiment some more with
AT that later)

This explains a lot. I had tried multicasting and decided there was
some problem with the network configuration. Tell me about PGM -
preferably off-list, since this is starting to get very OT, but I'm
posting the request here in case there's other interest.

AT 4. Low frequency (or very low frequency) packet exchange.

I think I'd still set up a tcp handler for this. In fact, I have. I've
worked with remote data collection devices that would send a few
packets every hour or so and we've used tcp for the connection. Of
course, in that case data loss was very important.

AT In general, my advice would be - always use TCP except when you can't.

Agreed.

-- 
-Mark Wieder
 [EMAIL PROTECTED]

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


Re: UDP sockets - again

2005-03-02 Thread Dar Scott
On Mar 1, 2005, at 6:17 PM, Alex Tweedly wrote:
(Actually, I think Rev doesn't fully handle broadcast - I can get it 
to send to a local-broadcast address and they are received by other 
devices - but I can't get Rev to receive them ... will experiment some 
more with that later)
I created a poorman's resource finder in Rev.  One of the problems that 
I found was that on some OSes the broadcast destinations included the 
sender's computer (Windows and Mac 9.2) but on others it did not (OS 
X).  I assumed this was a unix goof and not Revolution, but I could be 
wrong.

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: UDP sockets - again

2005-03-02 Thread Alex Tweedly
Mark Wieder wrote:
AT (And unfortunately, Rev doesn't support either multicast or PGM).
AT (Actually, I think Rev doesn't fully handle broadcast - I can get it to
AT send to a local-broadcast address and they are received by other devices
AT - but I can't get Rev to receive them ... will experiment some more with
AT that later)
This explains a lot. I had tried multicasting and decided there was
some problem with the network configuration. Tell me about PGM -
preferably off-list, since this is starting to get very OT, but I'm
posting the request here in case there's other interest.
 

Rev does support sending either broadcast or multicast - I can send UDP 
packets to 192.168.0.255 and also to 224.0.0.251 and receive them on my 
(on-Rev) echo server.

But it doesn't support receiving them - there's no access to raw sockets 
or to setsocketopt(). Thus, there is no way to let the system know which 
multicast groups are to be received (necessary both to get the system to 
send / respond to IGMP packets as well as to set the correct bits in the 
Ethernet driver to receive the packets).  (Not sure yet about receiving 
broadcast)

If there's anyone overhearing this and wondering what on earth multicast 
is, and wanting a techie intro  
http://www.cisco.com/warp/public/cc/pd/iosw/prodlit/ipimt_ov.htm

I'll send you PGM info off-list.
--
Alex Tweedly   http://www.tweedly.net

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


Re: UDP sockets - again

2005-03-02 Thread Dar Scott
On Mar 2, 2005, at 3:19 PM, Alex Tweedly wrote:
(Not sure yet about receiving broadcast)
You can receive broadcast.  You can't control what IP address you are 
listening on, though, if you are multihomed.

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: UDP sockets - again

2005-03-01 Thread Alex Tweedly
Mark Wieder wrote:
I normally tend to shy away from using udp, but there are areas where
you really need it (working with existing protocols for other apps,
etc.). Using udp can also bring up firewall issues.
I think of it this way: udp is packet-oriented while tcp is
stream-oriented. Udp gives you speed and low overhead but packets
aren't guaranteed to arrive. Tcp guarantees that the packets arrive at
the destination and arrive in order, but the message can be broken up
into an arbitrary number of packets (Elvi shasle ftt hebuil ding).
With udp the entire message (if it arrives) is in a single packet.
With tcp you have to parse the incoming stream to determine where the
information ends.
There are a few other circumstances where you might want to choose UDP 
rather than TCP, apart from the speed and low overhead cases.

1. Data is time-sensitive (or delay-, or jitter-sensitive), but not 
loss-sensitive

Obvious example is streaming audio or video, particularly in real-time 
or conversational mode. Most audio codecs are designed to be robust in 
the face of packet loss (e.g. audio samples spread over adjacent 
packets), but delays (which would be enforced by TCP NAKs and 
retransmits) are audible (visible) to the users.  The most common 
example of this today is VOIP, and that mostly uses RTP over UDP, rather 
than over TCP; however, the commercial streaming audio formats are often 
run over TCP (with bigger buffering to handle TCP-induced delays) 
because of firewall problems.

2. High bandwidth high latency networks.
If you need to deliver large files over high-latency networks such as 
satellite, the effects of the very high round-trip times can be 
dramatic, preventing TCP connections from using the full bandwidth in 
many cases. It may be easier to use UDP in conjunction with a delayed 
re-transmit mechanism (if you can ensure that the received data isn't 
used until the retransmit happens later), or with FEC (Forward Error 
Correction) to allow complete data reception even when some packets are 
lost.

3. Multicast or Broadcast.
TCP can't be used in either multicast or broadcast cases - but UDP can. 
In most cases where you have multiple receivers, it's clear that TCP is 
the wrong style of transport, and UDP is more natural.

If you really wanted something like TCP but sending to multiple 
receivers, I'd reckon you want to use PGM rather than rolling your own 
in UDP (but as a co-author of PGM, I'm biased :-)

(And unfortunately, Rev doesn't support either multicast or PGM).
(Actually, I think Rev doesn't fully handle broadcast - I can get it to 
send to a local-broadcast address and they are received by other devices 
- but I can't get Rev to receive them ... will experiment some more with 
that later)

4. Low frequency (or very low frequency) packet exchange.
For example, if you want to send one packet of info every hour (or every 
day), then you wouldn't want to keep a TCP connection open (in many 
cases, you couldn't keep the connection open because of transient 
problems), and wouldn't want the overhead of opening a TCP connection, 
sending one packet, and closing the connection again. (Maybe this is 
just a special case of the low-overhead advantage - but is different in 
that a single, persistent TCP connection isn't a viable option at all).

5,6,7 . There are others, but we're starting to get into the 
esoteric cases now.

In general, my advice would be - always use TCP except when you can't.
--
Alex Tweedly   http://www.tweedly.net

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


UDP sockets - again

2005-02-28 Thread John Rule

I think the inconsistency lies in the lack of documentation
regarding 'when' to use the 'with message' and 'how' RunRev is calling these
(or possibly this is a bug). For example:

## Some of these examples assume an open datagram socket...


Write STATUS to socket udpSocket with message getData

Or 

Read from socket udpSocket with message getData
Write STATUS to socket udpSocket

Or

Open datagram socket to udpSocket with message getData
Write STATUS to socket udpSocket

Or

Accept connections on port udpPort with message getData
Write STATUS to socket udpSocket


The handler getData is not called everytime, and the parameters
only have data 'sometimes', but my 'sniffer' shows that my device is ALWAYS
responding. What is the appropriate sequence, and WHEN does RunRev call
these 'with message' handlers?! I am getting unreliable results using
ANYTHING!

Logically, you would think that once I instruct the handler to
'read' from a UDP socket whenever it gets data (i.e. I have set the callback
handler), it should ALWAYS call this handler when data is received on that
open udp socket. Or, when I write data to an open udp socket with a handler
message, if the destination socket responds with data, the handler should be
called immediately. It does not ALWAYS work this way, but it is close, so I
believe there is a problem.

I do not have issues with regular sockets, just datagram sockets...


Here are my questions that I cannot find an answer to in the documentation:

- Once the getData handler is set, how often is it called?

- If I write to an open UPD socket with a handler message, is the handler
called 'anytime' data is received, or only for that call (i.e. am I setting
some internal function pointer)?

- Is the data stored somewhere when it is received for retrieval using 'read
from socket'?

- Is the data accumulated? How large is the buffer? Can I set this?

- How many parameters are there for the handlers?

- Once I set the callback handler, is it 'always' set? Is it reset when the
socket is closed?

- If I set a callback handler for ANY call (i.e. open 'with', write 'with',
read 'with', accept 'with') is this handler going to be called for ANY data
received?

I feel like I am shooting in the dark, and I am disappointed that
this information is not somewhere in the docs. Withholding this info (for
'Enterprise' or 'RevList' users) does not make me want to upgrade...it makes
me want to look somewhere else for solutions.


Thanks for any info,
John Rule

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


Re: UDP sockets - again

2005-02-28 Thread Alex Tweedly
John Rule wrote:
	I think the inconsistency lies in the lack of documentation
regarding 'when' to use the 'with message' and 'how' RunRev is calling these
(or possibly this is a bug). For example:
 

The documentation for UDP sockets is pretty sparse (or indeed, totally 
missing, and trying to use the existing docs is near impossible, because 
the differences between TCP and UDP sockets are quite significant).
Dar Scott provided me with lots of help a while ago - you may find more 
useful info in the email archives (around September).

Summary (of what worked for me - may be other ways)
1.To accept packets from others (i.e. be a server), then you do :
  -- note this command name is misleading
  -- for UDP, the accept simply registers this object to receive 
packets on this port
  --   and sets up the callback function to call when such a packet 
arrives
  repeat for each word W in lPorts
accept datagram connections on port W with message gotPacket
  end repeat

and then the handler gotPacket will be called with each arriving 
packet. In this case here, I simply reply to it ..

-- Server mode handlers
on gotPacket pHostPort, pData, pSock
  local tHostPort
 
  mylog Packet arrived from  pHostPort  on my socket  pSock
  mylogcontents:  pData
  open datagram socket to pHostPort
  write reply with   pData to socket pHostPort
  close socket pHostPort
end gotPacket

2. To be a client:
  -- open datagram socket: UDP is connectionless, so no network activity
  -- is required for this open - hence it will complete immediately.
  -- the message callback is used to receive any replies to packets 
sent over this socket
  open datagram socket to lHostPort with message gotReplyPacket
and then this gotReplyPacket will be called for any packets replied to 
as above; in my case

-- Client mode handlers
on gotReplyPacket pOtherOne
  mylog Packet arrived  paramCount()
  repeat with i=1 to paramCount()
mylog i  :  param(i)
  end repeat
end gotReplyPacket
That works for me - though I haven't tested it in any high-stress 
environment - it's been PC to PC, for chat-like apps, nothing that 
would send, for instance, a stream of back-to-back packets.

The handler getData is not called everytime, and the parameters
only have data 'sometimes', but my 'sniffer' shows that my device is ALWAYS
responding. What is the appropriate sequence, and WHEN does RunRev call
these 'with message' handlers?! I am getting unreliable results using
ANYTHING!
Logically, you would think that once I instruct the handler to
'read' from a UDP socket whenever it gets data (i.e. I have set the callback
handler), it should ALWAYS call this handler when data is received on that
open udp socket.
I don't have any code that reads from a UDP socket (that's not to say it 
can't be done - but all my code uses handles as in my examples above).

Or, when I write data to an open udp socket with a handler
message, if the destination socket responds with data, the handler should be
called immediately. It does not ALWAYS work this way, but it is close, so I
believe there is a problem.
 

There is no need (and probably no point in having) a with callback on 
UDP writes.

TCP sockets can be blocked because we've reached the maximum number of 
outstanding bytes, and cannot send any more until the remote system has 
received (and ACKed) some of what we've already sent; hence there may be 
a significant delay before the data can be sent - so rather than wait 
for that, you can pass in the callback handler, continue working and 
later be told when the data has gone.

UDP has no such issues - so the only delay possible would be network 
buffering (e.g. if you were sending to a very slow line). The call back 
function in the write should be called immediately - it has nothing to 
do with the remote system, and nothing to do with any response having 
been received.

I do not have issues with regular sockets, just datagram sockets...
Here are my questions that I cannot find an answer to in the documentation:
- Once the getData handler is set, how often is it called?
 

Should be called every time a packet is received for that socket
- If I write to an open UPD socket with a handler message, is the handler
called 'anytime' data is received, or only for that call (i.e. am I setting
some internal function pointer)?
 

question doesn't compute  data received is passed to the handler 
specified in either a
  accept connections
or an
 open datagram socket

- Is the data stored somewhere when it is received for retrieval using 'read
from socket'?
 

Don't use read from socket :-)
- Is the data accumulated? How large is the buffer? Can I set this?
 

No.
Presumably, max packet size.
No (UDP is datagram oriented - so you send and/or receive single data 
packets)

- How many parameters are there for the handlers?
 

For the getpacket handlers, 3 - host, port, data
For the write handler (which I suggest you don't use) - 1
- Once I set the callback handler

Re: UDP sockets - again

2005-02-28 Thread Dar Scott
On Feb 28, 2005, at 8:29 AM, John Rule wrote:
	I think the inconsistency lies in the lack of documentation
regarding 'when' to use the 'with message' and 'how' RunRev is calling 
these
(or possibly this is a bug).
Yes.  The docs are wrong for UDP.  There is no in-crowd except those 
who happen to catch the info on lists or find it in responses to bug 
reports in bugzilla.  Or who happened to stumble on it in tinkering.

It is also possible to overload a system with UDP datagrams.
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-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


  1   2   3   >