OT non LC: cross tab/window browser communication

classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|

OT non LC: cross tab/window browser communication

Mike Bonner
I have a problem I need to solve with a web page i've set up.. On my page
(my domain) I have forms that submit to an external domain (paypal) and
open a new named tab on submission.  I need to be able to block further
actions until the paypal page load is complete.  Currently, I have simply
set up a timer with an overlay and visual feedback letting the user know
that "stuff is being done,"  but since the response time from paypal can
vary greatly, I'm hoping there is a way to know when the tab has completed
loading, with a backup "max time" so that if the paypal load barfs, page
functionality is still returned.

Is this sort of thing possible?  I've researched, but if it can be done
apparently my search terms aren't the correct ones.

Thanks in advance for any help.  I'm afraid javascript (other than very
basic stuff) is not one of my strengths.
_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: OT non LC: cross tab/window browser communication

xtalkprogrammer
This is strange and very insecure. You should let the tab load and
redirect to the PayPal page after the tab has finished doing everything
it should do.

I had a similar problem though. I needed a page to give PayPal time to
process a transaction. I did this with a fake progress bar, which waited
1 minute and then reloaded the page. If the transaction has been
completed, I sent the license, but if the transaction hadn't been
completed, I showed a message saying that the license would be delivered
manually at a later time after additional checks had been performed.

Kind regards,

Mark Schonewille
http://economy-x-talk.com
https://www.facebook.com/marksch

Buy the most extensive book on the
LiveCode language:
http://livecodebeginner.economy-x-talk.com

Op 22-Nov-16 om 21:02 schreef Mike Bonner:

> I have a problem I need to solve with a web page i've set up.. On my page
> (my domain) I have forms that submit to an external domain (paypal) and
> open a new named tab on submission.  I need to be able to block further
> actions until the paypal page load is complete.  Currently, I have simply
> set up a timer with an overlay and visual feedback letting the user know
> that "stuff is being done,"  but since the response time from paypal can
> vary greatly, I'm hoping there is a way to know when the tab has completed
> loading, with a backup "max time" so that if the paypal load barfs, page
> functionality is still returned.
>
> Is this sort of thing possible?  I've researched, but if it can be done
> apparently my search terms aren't the correct ones.
>
> Thanks in advance for any help.  I'm afraid javascript (other than very
> basic stuff) is not one of my strengths.
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Kind regards,

Drs. Mark Schonewille

Economy-x-Talk Consultancy and Software Engineering
Homepage: http://economy-x-talk.com
Twitter: http://twitter.com/xtalkprogrammer
Facebook: http://facebook.com/LiveCode.Beginner
KvK: 50277553
Reply | Threaded
Open this post in threaded view
|

Socket communication

Ralph DiMola
In reply to this post by Mike Bonner
When one enables socket communication on the server side using the form
"accept [datagram] connections on port portNumber with message
callbackMessage", how do you stop accepting new connections? The LC lesson
show closing all open sockets but not how to prevent new connections.

Thanks!

Ralph DiMola
IT Director
Evergreen Information Services
[hidden email]


_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Socket communication

Phil Davis-5
That's a really good question Ralph!

Maybe you could put the 'accept' and 'callbackMessage' code in a script
that can be put into use / taken out of use and that would do it, but I
haven't tried it.

Phil Davis



On 11/22/16 1:11 PM, Ralph DiMola wrote:

> When one enables socket communication on the server side using the form
> "accept [datagram] connections on port portNumber with message
> callbackMessage", how do you stop accepting new connections? The LC lesson
> show closing all open sockets but not how to prevent new connections.
>
> Thanks!
>
> Ralph DiMola
> IT Director
> Evergreen Information Services
> [hidden email]
>
>
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>

--
Phil Davis


_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Socket communication

Phil Davis-5
For clarity, it would be nice to have a "stop accepting connections on
port x" command.
Phil

On 11/22/16 1:31 PM, Phil Davis wrote:

> That's a really good question Ralph!
>
> Maybe you could put the 'accept' and 'callbackMessage' code in a
> script that can be put into use / taken out of use and that would do
> it, but I haven't tried it.
>
> Phil Davis
>
>
>
> On 11/22/16 1:11 PM, Ralph DiMola wrote:
>> When one enables socket communication on the server side using the form
>> "accept [datagram] connections on port portNumber with message
>> callbackMessage", how do you stop accepting new connections? The LC
>> lesson
>> show closing all open sockets but not how to prevent new connections.
>>
>> Thanks!
>>
>> Ralph DiMola
>> IT Director
>> Evergreen Information Services
>> [hidden email]
>>
>>
>> _______________________________________________
>> use-livecode mailing list
>> [hidden email]
>> Please visit this url to subscribe, unsubscribe and manage your
>> subscription preferences:
>> http://lists.runrev.com/mailman/listinfo/use-livecode
>>
>

--
Phil Davis


_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Socket communication

Richard Gaskin
In reply to this post by Ralph DiMola
Ralph DiMola wrote:

 > When one enables socket communication on the server side using
 > the form "accept [datagram] connections on port portNumber with
 > message callbackMessage", how do you stop accepting new connections?
 > The LC lesson show closing all open sockets but not how to prevent
 > new connections.

After running "accept", check the openSockets.  You should see one which
has no IP address, and is just the port number you're listening on, e.g.:

   accept connections on port 4444 with message "foo"
   put the openSockets

..should yield:

4444

If you then close that you should be unable to receive further connections:

    close socket 4444

--
  Richard Gaskin
  Fourth World Systems
  Software Design and Development for the Desktop, Mobile, and the Web
  ____________________________________________________________________
  [hidden email]                http://www.FourthWorld.com

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Socket communication

Alex Tweedly-2
Yes, what Richard said :-)

Don't be misled by the dictionary - the socketID *may* start with an IP
address, but it doesn't need to - therefore you can simply
   close 8765

without an IP address, to close sockets you have 'accepted' on.

-- Alex.

On 22/11/2016 21:52, Richard Gaskin wrote:

> Ralph DiMola wrote:
>
> > When one enables socket communication on the server side using
> > the form "accept [datagram] connections on port portNumber with
> > message callbackMessage", how do you stop accepting new connections?
> > The LC lesson show closing all open sockets but not how to prevent
> > new connections.
>
> After running "accept", check the openSockets.  You should see one
> which has no IP address, and is just the port number you're listening
> on, e.g.:
>
>   accept connections on port 4444 with message "foo"
>   put the openSockets
>
> ..should yield:
>
> 4444
>
> If you then close that you should be unable to receive further
> connections:
>
>    close socket 4444
>


_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Socket communication

Phil Davis-5
Live and learn!
Phil


On 11/22/16 2:04 PM, Alex Tweedly wrote:

> Yes, what Richard said :-)
>
> Don't be misled by the dictionary - the socketID *may* start with an
> IP address, but it doesn't need to - therefore you can simply
>   close 8765
>
> without an IP address, to close sockets you have 'accepted' on.
>
> -- Alex.
>
> On 22/11/2016 21:52, Richard Gaskin wrote:
>> Ralph DiMola wrote:
>>
>> > When one enables socket communication on the server side using
>> > the form "accept [datagram] connections on port portNumber with
>> > message callbackMessage", how do you stop accepting new connections?
>> > The LC lesson show closing all open sockets but not how to prevent
>> > new connections.
>>
>> After running "accept", check the openSockets.  You should see one
>> which has no IP address, and is just the port number you're listening
>> on, e.g.:
>>
>>   accept connections on port 4444 with message "foo"
>>   put the openSockets
>>
>> ..should yield:
>>
>> 4444
>>
>> If you then close that you should be unable to receive further
>> connections:
>>
>>    close socket 4444
>>
>
>
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>

--
Phil Davis


_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

RE: Socket communication

Ralph DiMola
In reply to this post by Alex Tweedly-2
Richard/Alex,

Thanks!!! As Phil said "Live and learn". The LC example did work because it
closes all open sockets, I just did not know why it worked.

Ralph DiMola
IT Director
Evergreen Information Services
[hidden email]


-----Original Message-----
From: use-livecode [mailto:[hidden email]] On Behalf
Of Alex Tweedly
Sent: Tuesday, November 22, 2016 5:04 PM
To: [hidden email]
Subject: Re: Socket communication

Yes, what Richard said :-)

Don't be misled by the dictionary - the socketID *may* start with an IP
address, but it doesn't need to - therefore you can simply
   close 8765

without an IP address, to close sockets you have 'accepted' on.

-- Alex.

On 22/11/2016 21:52, Richard Gaskin wrote:

> Ralph DiMola wrote:
>
> > When one enables socket communication on the server side using the
> > form "accept [datagram] connections on port portNumber with message
> > callbackMessage", how do you stop accepting new connections?
> > The LC lesson show closing all open sockets but not how to prevent
> > new connections.
>
> After running "accept", check the openSockets.  You should see one
> which has no IP address, and is just the port number you're listening
> on, e.g.:
>
>   accept connections on port 4444 with message "foo"
>   put the openSockets
>
> ..should yield:
>
> 4444
>
> If you then close that you should be unable to receive further
> connections:
>
>    close socket 4444
>


_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: OT non LC: cross tab/window browser communication

Mike Bonner
In reply to this post by xtalkprogrammer
My problem is the same. *kinda*  Basically i'm "adding to cart" and not too
long ago.. something changed and it can take 7 or 8 seconds to decrypt the
button code.   Not that big a deal, but people like me, click once, leave
the cart tab open, and then go back to the main shopping tab and click more
stuff to add. At this point the background tab doesn't become active, and
if they click several items in quick succession, any items that don't
complete don't appear in the cart.

There are a few ways I can work around this. The first effort is similar to
what you're talking about and is what I have done so far.  Click an add to
cart button, and an overlay and progress indicator blocks further actions
for a set amount of time.  This works pretty well, but as mentioned.. if
paypal decides to be even slower, its still slightly possible for the user
to add more items before the process completes.

Another option, I could force the user to go to each individual items page,
click to add, then make them go back to the first page to then chose
another item, load a page, and click again.  I really don't want to do
this, I don't like the way things flow.

Yet another option would be to maintain my own cart, and then do an upload
to paypal of all items at once.  I think it is possible to make this work
with self hosted encrypted buttons, but would require a heavy recode, and
which I hope to avoid because it might put it beyond the current ability of
the people who may have to maintain it.  I'm working with them, but the
current setup for adding and managing items works REALLY well for them.

I didn't think it was possible to do what I wanted, but was hoping maybe
there was some "document complete" message handed back to the original
calling page.  Thanks for the input, I'll keep pondering.

The strange thing is that a month ago, everything was fine, but paypal has
rolled out a new cart page that is MUCH less responsive than the old one.
Yet a simple "view cart" button still goes to the old style page.
Apparently the new page has been rolled out in waves and it finally caught
up to us.

On Tue, Nov 22, 2016 at 1:42 PM, Mark Schonewille <
[hidden email]> wrote:

> This is strange and very insecure. You should let the tab load and
> redirect to the PayPal page after the tab has finished doing everything it
> should do.
>
> I had a similar problem though. I needed a page to give PayPal time to
> process a transaction. I did this with a fake progress bar, which waited 1
> minute and then reloaded the page. If the transaction has been completed, I
> sent the license, but if the transaction hadn't been completed, I showed a
> message saying that the license would be delivered manually at a later time
> after additional checks had been performed.
>
> Kind regards,
>
> Mark Schonewille
> http://economy-x-talk.com
> https://www.facebook.com/marksch
>
> Buy the most extensive book on the
> LiveCode language:
> http://livecodebeginner.economy-x-talk.com
>
> Op 22-Nov-16 om 21:02 schreef Mike Bonner:
>
>> I have a problem I need to solve with a web page i've set up.. On my page
>> (my domain) I have forms that submit to an external domain (paypal) and
>> open a new named tab on submission.  I need to be able to block further
>> actions until the paypal page load is complete.  Currently, I have simply
>> set up a timer with an overlay and visual feedback letting the user know
>> that "stuff is being done,"  but since the response time from paypal can
>> vary greatly, I'm hoping there is a way to know when the tab has completed
>> loading, with a backup "max time" so that if the paypal load barfs, page
>> functionality is still returned.
>>
>> Is this sort of thing possible?  I've researched, but if it can be done
>> apparently my search terms aren't the correct ones.
>>
>> Thanks in advance for any help.  I'm afraid javascript (other than very
>> basic stuff) is not one of my strengths.
>> _______________________________________________
>> use-livecode mailing list
>> [hidden email]
>> Please visit this url to subscribe, unsubscribe and manage your
>> subscription preferences:
>> http://lists.runrev.com/mailman/listinfo/use-livecode
>>
>>
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>
_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode