Real Software Forums

The forum for Real Studio and other Real Software products.
[ REAL Software Website | Board Index ]
It is currently Wed Nov 21, 2018 5:19 am
xojo

All times are UTC - 5 hours




Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: PHP or Ruby SSE Server side event with RS desktop client ?
PostPosted: Mon Aug 22, 2011 6:40 pm 
Offline

Joined: Tue Mar 23, 2010 8:44 pm
Posts: 673
Hi.
I am making a chat server and an accompanying RS desktop chat client.
Since my web host cannot run an RS cgi app I need to make the chat server in a language that works on the server. PHP or Ruby would be acceptable.
I dont want the clients to have to constantly ping the server for new data checks.

HTML 5's SSE allows servers to push data to clients so the clients no longer have to constantly ping the server to check for new data.
I have never used SSE before but it sounds like it could work.

Can an RS made client work correctly by recievig incoming data from the server on port 80 (the web port) ?
Would that mess up the users browser browsing?


Besides an initial data send from the client I think the HTTP socket would need to listen for new incoming data from the server and send data back when it needs to.
Im not sure but I dont think there is much more to it than that.

I was thinking about having the client pretend to be a browser but I'm not sure what that requires and my first attempt failled.
Anything beyong setting the useragent info?

I thought about using a TCP socket to listen for the pushed data but I dont know if they can listen on port 80 without requiring the user tto give the app priveledges or something wierd.
I would like to use port 80 to not cause problems for the user or make them have to open up different ports which many may not be able to do.

Does anyone know about this?


Top
 Profile  
Reply with quote  
 Post subject: Re: PHP or Ruby SSE Server side event with RS desktop client
PostPosted: Mon Aug 22, 2011 8:37 pm 
Offline

Joined: Tue Jan 31, 2006 5:22 am
Posts: 124
Location: La Coruña, Spain
By don't use UDP and ENet plugin from Einhugur for that? It would run as a service and it's very easy to implement.

_________________
¡No lo intentes! Hazlo o no lo hagas, pero no lo intentes.


Top
 Profile  
Reply with quote  
 Post subject: Re: PHP or Ruby SSE Server side event with RS desktop client
PostPosted: Mon Aug 22, 2011 11:10 pm 
Offline

Joined: Tue Mar 23, 2010 8:44 pm
Posts: 673
Amando wrote:
By don't use UDP and ENet plugin from Einhugur for that? It would run as a service and it's very easy to implement.


hi.
I dont know what the Enet does but I am not interest in buying it.
UDP is not good to use for this.


Top
 Profile  
Reply with quote  
 Post subject: Re: PHP or Ruby SSE Server side event with RS desktop client
PostPosted: Tue Aug 23, 2011 3:36 am 
Offline

Joined: Mon May 31, 2010 5:35 am
Posts: 2412
Location: Netherlands
J.Sh3ppard wrote:
Amando wrote:
By don't use UDP and ENet plugin from Einhugur for that? It would run as a service and it's very easy to implement.


hi.
I dont know what the Enet does but I am not interest in buying it.
UDP is not good to use for this.


i hav tested enet and it does preform better and is even as reliable as tcp. enet is a master piece of engineering a (chat/game) server.

tcp would do but requires more computer and server power.

just my 2c

_________________
SWORT™
- Windows Vista, Windows XP, Windows 7, Linux Mint 11 and Mac OSX Lion
- REAL Studio Enterprise(latest) and WEB Edition(latest)
- Plugins (MBS Complete, ToringoLib, Einhugur, VanHoek + Some open source plugins)
For Dutch User Groups ask me to enter!


Top
 Profile  
Reply with quote  
 Post subject: Re: PHP or Ruby SSE Server side event with RS desktop client
PostPosted: Tue Aug 23, 2011 8:03 am 
Offline

Joined: Mon May 31, 2010 5:35 am
Posts: 2412
Location: Netherlands
J.Sh3ppard wrote:
Hi.
I am making a chat server and an accompanying RS desktop chat client.
Since my web host cannot run an RS cgi app I need to make the chat server in a language that works on the server. PHP or Ruby would be acceptable.
I dont want the clients to have to constantly ping the server for new data checks.

HTML 5's SSE allows servers to push data to clients so the clients no longer have to constantly ping the server to check for new data.
I have never used SSE before but it sounds like it could work.

Can an RS made client work correctly by recievig incoming data from the server on port 80 (the web port) ?
Would that mess up the users browser browsing?

Besides an initial data send from the client I think the HTTP socket would need to listen for new incoming data from the server and send data back when it needs to.
Im not sure but I dont think there is much more to it than that.

I was thinking about having the client pretend to be a browser but I'm not sure what that requires and my first attempt failled.
Anything beyong setting the useragent info?

I thought about using a TCP socket to listen for the pushed data but I dont know if they can listen on port 80 without requiring the user tto give the app priveledges or something wierd.
I would like to use port 80 to not cause problems for the user or make them have to open up different ports which many may not be able to do.

Does anyone know about this?


Hi Sh3ppard,

Why would you create a web (script) application completely on a different language just because the server can't handle it? It's possible with the right settings, and if your (if you rent) hoster was good he would have set it up for you so you can do your work...

Anyway i just made a post about Einhugur Enet plugin, which will be perfect for chat/game/stream applications (even web compatable).

If you don't want plugins and would use php then i would recommend using some kind of php framework (most are free). Most of those have big communities and they can help you setup the PHP part... I don't know about ruby, python etc but they have huge communities to which can help with your server part (if you going to use other language than Real Basic and Web Edition).

You can do chat in different ways: use websockets (protocol), use your own protocol, use httpsockets, use TCPSocket use UDPSocket or use EasyTCPSocket or EasyUDPSocket.

I would not use the same port as your WebPage uses, instead use another like 8000 (open on server firewall) or one you want to use and is not already in use.

Use headers if you have HTTPrequests for the chat, you can set headers of the HTTPSocket and read those from HTTPSocket (server) or other languages like php, python, ruby (on rails), even LUA web...

Maybe this will help you a bit selecting what you will be going to use, i'm creating an example for Enet which will be a chat type (Web Application as server and Client on a desktop).

You can always contact me if you want, privacy is my policy when you need it.

_________________
SWORT™
- Windows Vista, Windows XP, Windows 7, Linux Mint 11 and Mac OSX Lion
- REAL Studio Enterprise(latest) and WEB Edition(latest)
- Plugins (MBS Complete, ToringoLib, Einhugur, VanHoek + Some open source plugins)
For Dutch User Groups ask me to enter!


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC - 5 hours


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group