how to make a facebook-like chat - c#

I always wondered how to make an instance chat using ajax ! Ideas !? articles ?!
Thank you .

You basically just use AJAX to "subscribe" to messages pushed by a chat server. Then the client "publishes" messages which the server pushes to any clients subscribed to that channel.
NodeJS is great for instant ajax stuff like facebooks live feed or chat (Check out this open source example).
You can also give a look at the AjaxIM project which has a chat bar like facebook and has a NodeJS server and a PHP server (I suppose you could port that over to ASP.Net). I'd reccomend going with the NodeJS server and just use the javascript library to connect to it from your project.

A friend of mine released a project for helping to write the backend of such a feature, it's called the LiveChat Starter Kit and is available on CodePlex. I never tried it so can't comment on its use, but it have gathered some attention there. I think it's more curtailed to commercial websites for providing online support tough.

All that happens is that the javascript on the client uses ajax to send outgoing chat to the server, and the server uses ajax to send incoming chat to the client.
Of course there are a lot of different pieces involved but if you have questions about those, you should ask them.

I would suggest to use XMPP as it an open standard and quite a few implementations also available, following are some links which may help:
Ajax jabber/XMPP client recommendations (real experience only please) !
http://xmpp.org/
http://www.jabber.org/

Related

How to create a simple restful server / client solution in c#

I'm trying to create a server based around the restful api (basically a client - server system which listens on a specific port but all the tutorials I've seen were using asp.net, some databases or not suited / too complex.
I've tried The Msdn Tutorial, That One CodeProject and That Other CodeProject Tutorial and also haven't found a simple solution here either.
I was thinking of a solution like:
Server listens on specific port for restful requests (Lets call it "ServerListener") and handles the request then in a static "CheckNumber" if its either positive or negative. It'll then reply to the client with the value "positve" or "negative" (depending on its value). The client then shows a MessageBox with the result.
The final idea would be having the server being proxied by an nginx server which handles the the encryption with the client and sanitizing the request.
Please check https://msdn.microsoft.com/en-us/library/windows/desktop/aa364510(v=vs.85).aspx
The Http API will give you the freedom to implement your server without Asp.Net, without WCF, and even without IIS.
Check my post, it contains several examples for simple REST server implementations, including C#, Java, PHP and node.js.

Talk to javascript with c# and vice versa

I am creating a website where I need to have access to the clients files. I know that the client will have to accept some warning message and also run my progam.
I have reaserched on the internet and I know that I can acomplish this with Web Sockets. I have been able to establish a tcp connection localy from c# and google chrom html 5 websocket. the problem with websockets is that it did not work with other browsers.
Another solution that I was thinking was to use cookies to exchange messages. I havent tried that and I dont think that will be efficient.
Some websites when giving them privilades are able to use java. I have no idea how they exchange messages but maybe there is a similar way of doing it with c#
Look at SignalR -- https://github.com/SignalR/SignalR. Be careful though, web sockets (and any other "per user" type connection has server resource implications -- see http://robrich.org/archive/2012/04/05/The-real-time-web-in-ASP-NET-MVC.aspx

How to push messages from API server (PHP/rest) to C# apps

I have C# apps requesting data from PHP/MySQL API server (Rest/JSON). Now I also need to push messages to the C# apps when some events occur (form submission from the web site). I searched around, and it seems that COMET, long polling, and http streaming are options. Could you please provide some suggestions on which technology makes sense here, as I am not pushing to a web browser?
In addition, if using HTTP streaming (like twitter streaming API), do I need to keep a table of HTTP connections so I know which connection to use when pushing targeted events (only to certain C# clients)? I am a bit confused, and many thanks!
Make a WCF Web Service. http://www.codeproject.com/KB/WCF/WCFWebService.aspx
To connect using PHP: http://weblogs.asp.net/gunnarpeipman/archive/2007/09/17/using-wcf-services-with-php.aspx
In micro-services environment you might want to communicate between more different coding languages in the future, that's why in Kaltura we expose every API with descriptive XML that we can use later to generate client libraries in multiple coding languages, our code generator includes client libraries for C# and PHP.
I also published several REST server examples, including C#.

is there a way to let the web server (not the Client which is the trivial case) send a messege to a Client application?

I'm about to start to develop and application in C# but I realized that I haven't the enough knowledge to develop it yet :S.
The thing's that I need to find out a way to let the Web server comunicate with my application, i.e., in short, is there a way to let the web server (not the Client which is the trivial case) send a messege to a Client application?
I know that I way to solve it's to make Client applications periodically send messages to the web server but that's not what I want 'cause polling generates overhead
Sorry about my english! I'm not a native speaker.
Thanks in advance!
Generally this type of interaction is achieved with Comet or WebSockets - I'm not sure how your app will be communicating with the server, but I would bet you can do what you're trying to do using one of those.
You could implement a WCF service in your client that could listen for a connection from the server (or anything else). The server can communicate with the client as easy as calling the API.
Getting started with WCF is really easy using the wizards in VS.
Here is a link that talks about using WCF with ASP, but it can be used outside of asp as well.
It seems like you meant "push" messaging, the challenge around this is for the server to keep track of the lost of clients and manage who should recieve which message.
If you want to get it done with minimal overhead you can check out the Amazon Simple Notification Service.
SNS is a cloud-based messaging and notification service hosted and managed for you, SNS is based on a topic/subscriber model and you set it up via a few simple API calls, it is metered but quite inexpensive for the most part.
edit: For C# Libraries and frameworks to do it yourself, I am not an expert in the C# world so I think other answerers will know it better.
Disclosure: I work at amazon so I am naturally inclined to like their product

send a text message via .net

All: Are there any free solutions out there for sending text messages (SMS) via .net? (maybe a web service or something?).
EDIT
What I'm really looking for is a reference for a reputable online service that I can use for sending SMS messages. Has anyone out there used such a service, and if so, can you give me a recommendation/warning?
EDIT
(first the disclaimer: I'm not in any way associated with this company, I'm just posting back what I found, in case anyone else out there is looking)
An update: I ended up going with www.clickatel.com My work was for a technology exploration and demo project,and I could buy credits on that system cheap. In my case, I started out using their REST API. I had problems with that api (sometimes the commands would timeout). So I switched to the web service API (SOAP) It worked very well for me.
Most accept email but it is vendor specific.

Categories

Resources