How can I manage "keep alive" connection?

LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
ale870
Posts: 250
Joined: Tue Apr 22, 2008 9:17 am
Contact:

How can I manage "keep alive" connection?

Post by ale870 » Tue Apr 29, 2008 12:54 pm

Hello,

I'm new in Revolution Studio (I'm an old user of Asymetrix Toolbook ;-) ).
I just bought this great tool, and this is my first post :-)

I'm making some tests using http (I wish to use Revolution Studio as rich client over an application server java).

I access to the server via Rev using the following code:

Code: Select all

get url ("http://xxxxxxx/ServletExample1/Test1?" & ("username=" & UrlEncode(field "username") ) )
"xxxx" are server name and port.

I noticed that every call creates a new session in the server, and I cannot find any info about the parameter "keep alive", which could be used to "inform" Rev to use the same session instead opening a new one.

Is it correct? Is there any way to let a client talk with a server in a single session?

thank you!

Janschenkel
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 977
Joined: Sat Apr 08, 2006 7:47 am
Contact:

Post by Janschenkel » Tue Apr 29, 2008 10:04 pm

You could try setting the 'httpHeaders' to include a line for Keep-Alive.

Code: Select all

on mouseUp
  set the httpHeaders to "Connection: Keep-alive"
  get URL "http://www.example.com/example.jsp?param=example"
end mouseUp
When you set the 'httpHeaders' property, you're adding to/overriding standard HTTP headers that are sent as part of the request.

Hope this helped,

Jan Schenkel.
Quartam Reports & PDF Library for LiveCode
www.quartam.com

ale870
Posts: 250
Joined: Tue Apr 22, 2008 9:17 am
Contact:

Post by ale870 » Tue Apr 29, 2008 11:40 pm

Thank you!
Tomorrow I will try your suggestion!

Post Reply