Web Application Server - host

I'm very new to web development but I will try to explain my question as best I can.
I am making a basic chatroom program (in C#) but I have never made my own online server before, and it needs to respond to tcp packets. I know how a server works, I just don't know how to implement my server and how people will be able to access it.
Hope thats clear. Thanks in advance.
Edit: Sorry I didn't mean to ask for examples of chat/server applications, I already know how they work. My question is how do i host an online server that is accessible to anyone?Are they written in php? asp?I dont want to be running an application on my computer that will be the "server". Thanks!

If you like to study some existing network applications, i recommend the twisted project; it contains a web server, numerous chat clients, chat servers, mail servers, and more.
Some example C# code for a chat client and server: http://www.developerfusion.com/code/3574/a-chat-clientserver-program-for-c/

You can take a look at Web Tornado.
They have a chat application sample, and it's basically a light, non-blocking web server. It is written in python.

if you are using c# then you can have a look on signal R as well. It is getting popular because of event based pull / push mechanism which may assist you in the development of chat room.

Related

C code to open web browser

What are some possible ways if any to execute a web browser on someone else's computer? I have a server and now when I use Process.Start. When someone executes that code from another computer the browser will show up on the server only.
What are some ways to have the browser open in their computer instead?
In effect you're asking how to execute code remotely. This is done by using some form of RPC. There are many RPC frameworks out there, so no definite answer can be given. Pick an RPC framework suitable for your situation and them you could ask a more specific question pertaining to that particular framework.
If, on the other hand, you're asking how to execute code on a client who just visits your web server, then no, that's not possible. And it's that way intentionally. Imagine the security implications if random websites would be able to run programs on your computer.
Have your game client open a browser. From the way it sounds, the server should never really be aware of any of this.

Easiest way to get online notifications

I have some C simulations running on my university servers and I am bored of having to sit and wait for them to end, considering they take quite a while. So I want to develop some kind of mechanism to know when they have ended. I was thinking of implementing an SMTP client with gmail, but considering I can't install anything on the system I wasn't able to add the SSL libraries to do so. I also can't remote access my desktop from outside campus. So once I leave I can't VNC y desktop.
So I was thinking if there is some way where I can rent some online space for free and be able to talk with the server through ftp or http and set add some text that the simulation has ended. That way I can check the space from home and know it ended.
I know the question is quite messy, and hope someone can help point me out to someideas.
Thanks
I'd recommend, 100webspace.com, it allows PHP and MySQL, all for free! Then just send data to it with HTTP PUT and/or GET and view the results over the interweb.
My trawling of the web consistently turns up libcurl as the library of choice for interfacing C with HTTP commands. This is a sample using it with the PUT method.
A possibility would be using a simple blog and updating it via HTTP. Just as an example, blogger supports simple messages in XML. (REST would be my first choice but XML is not that bad)
Edit:
Tumblr does support using an HTTP POST without XML.

Apache with Comet Support

I'd like to build a multiplayer web game application in which it supports chat. I presume the application will have to handle hundreds of simultaneous connections.
I'm planning to host my application in a shared web hosting, which has these limitations (most likely similar to PHP + Comet (long-polling) scaling / hosts):
It does not seem I can change the web server. Most likely it's using Apache.
Supports MySQL 5, PHP 5.3.x, Perl, Python, Ruby on Rails, CGI
(To be more precise, I'll be using HawkHost's shared web hosting.)
And here are my result of research, followed by my questions:
Some resources (like Python Comet Server) say that PHP is not good for handling concurrent connections, while Python is better choice. Is this true?
I've tried the long polling technique in PHP (although I don't know whether it's correctly implemented or not, like Comet issue with abandoned open connections) using "Loop endlessly until the data changes." method. This almost works. The remaining problem is that the server process never dies when the browser is closed (the server does not know that the connection has been terminated, and the data never changes). Is there any way the PHP can detect whether the browser has been terminated so that it stops the loop?
I've been looking everywhere to look for answers but still I can't conclude anything. This topic has also been asked on StackOverflow so many times, I'm sorry if I may sound repeating >.<.
Currently I am able to code using PHP, MySQL, and JQuery for JS. I'm still new to the term Comet and Server Push. If necessary, I'm also willing to learn new scripting language like Python.
I appreciate any insights of what scripting language, framework, and techniques to use to start my project.
When you have a shared hosting environment and there are a number of restrictions enforced then it's a good idea to outsource the realtime functionality. I would say this since I work for one such company, Pusher. But I hope others will back me up on this.
When using a hosted solution you can push a notification by making a HTTP request to a RESTful API. The service will then deliver the message to the connected Web Client (browser). The browser does need to include a script tag or use a library that also connects to the hosted service.
The main benefits are:
No installation or maintenance
No need to handle persistent connections - no resource usage
Really simple usage: Script tag in app and call REST API
The hosted solution handles scaling
Also, here's a list of hosted realtime solutions.
So you can use Python. Then you can use Tornado. (psst... facebook uses it)
And I had same problem with open connections. Just don't spend time for search solution in PHP - later you will be sorry. I was. Just use what is made for Comet. If you more prefere JAVA, then there is: CometD.
And for game get a normal hosting. They cheap this days.

Need help understanding chat, XMPP, jabber id's, etc

I'm creating a mobile app that runs on iOS, Android, BB and Win7. It's a location-based app and you can join groups and then be able to see the location of other members of the group. That's all fine and good. I'm currently using GAE to manage the groups.
Now I'd like to add the ability for members of the group to chat with each other. No 1-1 IM but 1-many chat room. So when you've accessed a certain group in the app, you can type a message and all other members of that group will be able to see your message. I started down the road of mobile push (APNS, C2DM, etc) but thought there had to be a better way. I only want the messages coming in if the app is actually running anyway, so the important part of mobile push is not important in this case. But I of course don't want to poll either.
So I started looking into XMPP and it seems like the right solution, but I'm new to this technology. I don't want the user to have to already have, or create some online IM presence with some service of his choice. I'd like to just have a "Username" pref in the mobile app and that's all he ever needs to do.
So that's where I really need some help. Can I programatically create a chat room somewhere and ids for the users of the group? Would I need to host my own XMPP server (which I understand will not work with GAE).
Or am I just of course altogether than there's a better solution?
Thanks very much for any help.
Warren
I use QuickBlox.com as a back-end for my application. It has built-in Chat module based on XMPP and also a Messages module which can help you to send cross platform pushes to iOS, Android and WP7.
By the way, chat module supports groups in MUC (multi user chat) and they also have a sample to integrate the chat into our app.
Check http://hosted.im/ there is free plan (5 users) at least you can test it.
Regarding XMPP implementation, you can do what you want but you will need to run your own xmpp server
Servers:
ejabberd
openfire
jabberd
jabberd2
tigase
I don't know if GAE support extension I can't help you here.
Hope this help a little bit.
even the question is little bit old i think this will be useful for other techbees.. :)
You can use Quickblox as your server with registering with them they have different plans for users including free plans.
Also if you want you can maintain your own server.
aSmack is good library for implementing XMPP for android. You can get both the jar and source from the aSmack site. just google it.
But from my own experience its a little bit tough to implement the Multi user Chat..

Query SQL Server Database from native iOS Application

I am working on an in-house, iOS app that will need read-only access to a SQL Server with multiple databases. I know the stock answer here is "write some web services", but I'd like a solution that is self-contained. Is there any way to directly connect to a SQL Server database from an iOS application? I'm thinking something like a basic ODBC connection.
I've seen a lot of users asking this question, but very few answers other than "write a web service." Is that really the only way?
A web service is indeed the only way, but Red Gate's written one you can reuse:
http://www.mobilefoo.com/iSqlServerSDK.html
http://labs.red-gate.com/Tools/Details/iSqlSDK
It's not officially released yet, just in beta, so keep in mind that features & prices may change.
Actually the easiest way is to create a MVC 3 or 4 asp.net web application. call the web methods. You don't need any API to pay for.
I use SBJson to serialize domain object and then send the objects as serialized jSOn to MVC 3. It's super easy to do. I even send images with base64, so it's .net compatible.
See my blog post with sample code:
http://nickturner.wordpress.com/2012/10/09/107/
So, after much searching and trial and error, unfortunately the best (only?) way I've found is indeed using Web Services.
Fortunately, Linq to SQL makes the WCF-creation-side incredibly easy. Once I got someone at work to walk me through setting up a Windows web server and adding the web service (and buying access to an online web server), the Windows side was up and ready to go.
I'm still working through all of the syntax stuff on the SOAP interaction side, but keeping my different methods somewhat similar in structure allows me to tinker a little until it works. By this time, I think I've gotten it to work pretty well.
So, both answers I got back were (disappointingly) correct. The only way to interact is through a Web Service. Even the 3rd party solutions they mentioned were really just convenient wrappers around the same type of technology. As it turns out, I'd rather have finer control over the process.
One word of advice: Get a real, external web server. I tried doing this on a non-Server Windows VM on my iMac/MacBook Pro, and it was like pulling teeth! Once I actually got access to an external, full, stand-alone web server, the process was much more streamlined and easy. Do yourself a favor and take that headache out of the equation!
There was a SQL ISAPI extension as part of SQLXML, but I think it has been deprecated: http://msdn.microsoft.com/en-us/library/aa226559%28v=SQL.80%29.aspx
This was effectively a pre-built, and relatively open, web service - so I'm not sure this counts as a direct connection.
You could also check out http://odbcrouter.com/Main

Resources