facebook like chat application in ASP.net - c#

I want to build web based facebook like lightweight chat for my site.
Website build on ASP .net on SQL server 2005.
I am interesetd in XMPP commmunication, but not able to find open source XMPP server with supportedlibrary for C# so that I can create client for my site.
Have checked googling butno luck for C# library; all I could found is plugin and jar.
Is it possible to implement chat logic and XMPP server communication in different language, and accessing thisdata through iframe or by other means on my site.
Thanks,
Hitesh.

http://www.ag-software.de/agsxmpp-sdk/
That library seems to be pretty good.

What you'll want to do is follow jgauffin's suggestion, and use an XMPP library on the backend, and then typically you'd add in a comet server for integration with your web frontend (we've actually done exactly this # Frozen Mountain, using WebSync).
If you're building a smaller site and/or don't need the "realtime" aspect, you could probably get away with polling as well, in which case you'd need to store the results from the XMPP library in your own system, and poll that (since XMPP is strictly event driven).

There are many options to send a message since first human! But how about the intelligence on it, automated collaboration in object level or shared objects among the users etc. I suggest you to take a look for the samples in here and feel the difference.

Related

Live Messenger app Windows Phone 8

I want to create an Instant Messaging app for Windows Phone.
I have found some information about Live SDK, but it looks like the messenger api is outdated?
Can anyone help me start? All I want to do at first is embed the IM.
A simple IM app where the user logs in with their Live ID, sees who already has the app (Live Contacts) and an IM-service with a UI like the SMS-service in windows phone.
Can anyone help me get started?
Firstly i hope i got your question right.
I have multiple lookouts for you:
XMPP (Jabber): start from there. It is fairly simple, and there are opensource clients out there where you can dismantle code and learn by understanding what others have done.
Check out the SignalR
ASP.NET SignalR is a new library for ASP.NET developers that makes it incredibly simple to add real-time web functionality to your applications. It's the ability to have your server-side code push content to the connected clients as it happens, in real-time.
You may have heard of WebSockets, a new HTML5 API that enables bi-directional communication between the browser and server. SignalR will use WebSockets under the covers when it's available, and gracefully fallback to other techniques and technologies when it isn't, while your application code stays the same.
SignalR also provides a very simple, high-level API for doing server to client RPC (call JavaScript functions in your clients' browsers from server-side .NET code) in your ASP.NET application, as well as adding useful hooks for connection management, e.g. connect/disconnect events, grouping connections, authorization.

What is the right method for a web chat application in c#

i'm trying to make a chat application using c# that connects to a web server in order to check if there are messages available.
I've tried that by creating HttpWebRequest to check for messages every second, but i notice that it's not good for the server, imagine if there are thousands of users and each user sends an HttpWebRequest every second, that would be heavy.
I heard something about synchronous connection but i think it also sends the same number of HttpWebRequest, (i'm not sure about this part).
So please does any one know the right method for a chat application?
Perhaps SignalR might be useful in your case.
ASP.NET SignalR is a new library for ASP.NET developers that makes it incredibly simple to add real-time web functionality to your applications. What is "real-time web" functionality? It's the ability to have your server-side code push content to the connected clients as it happens, in real-time.
Actually the most typical tutorial using this technology is web chat.
Use the Remoting.Net
see this :
http://www.codeproject.com/Articles/62813/NET-Remoting-Events-Explained
http://www.codeproject.com/Articles/12586/Remote-Execution-Using-NET-Remoting

How To Structure A Web/Client Support Chat System

I am looking to build an online customer support system for one of our company sites and had a few queries with regards to the structuring.
The scenario is this. We would like users of our site to be able to click a "Live Chat Support" button, at which point they would get a popup that tries to connect them to one of our support team.
Our support team on the other hand, will be running desktop clients. Whenever a user on our site clicks the link, all of the desktop clients will "ring". Whenever a support team member "answers" the call, the other clients will stop ringing and that member will begin chatting with the web user.
Given that our desktop client will be made using WPF in C#.NET and our site is ASP.NET MVC 2 - what would be the best way to establish communication between the two?
My initial thoughts were to have the web side store the chat in an SQL database and somehow "Ping" the relevent desktop client telling it to update its chat log. Similarly for the desktop to the web. But I am unsure how to go about implement this between two different platforms. If it were desktop client to desktop client I imagine it would much easier, but this is not the case.
Also, please bare in mind that I realise there are already commercial applications out there that do this. However, we require some bespoke functionality that goes beyond a simple chat - it is not worth going into the specifics but basically we must implement our own solution.
Any help is much appreciated.
Web technology is an inappropriate platform for implementing real-time interaction. It can be done, of course, but you will certainly have issues with scalability, responsiveness and development effort. I urge you to examine your requirements very carefully and consider whether it is at all possible to leverage a vendor product to accomplish what you want to do.
If you still want to strike out on your own, the main hurdle you will have to overcome is how to push messages to the browser. "Pinging" the browser from the server is impossible using pure web technologies, because HTTP is built on a "pull-only" request/response model. There is no persistent connection maintained between the client in the server. After the server has finished sending the page to the broswer, the connection is gone.
You could poll the web server for new messages, but this is not a scalable solution. If you're only dealing with a very small (say single digits) number of users, then this might work, but your responsiveness will be limited by the speed at which you poll, and the faster you poll, the less scalable this solution will be.
A better solution would be to use Silverlight, Flash, or some other thick-client technology running in the browser. Then you could implement a service that handles message routing between clients. This article on CodeProject might be a good place to start.

How are server side applications created, how is client - server communication done?

I would like to have a client-server application written in .NET which would do following:
server is running Linux
on the server there is SQL database (mySQL) containing document URLs
What we want:
- server side would regularly crawl all URLs and create a full text index for them
- client side would be able to perform a query into this index using GUI
The client application is written in .NET using C#. Besides of searching in documents it will be able to do a lot of other things which are not described here and which are done client-side very well.
We would like to use C# for the server side as well, but we have no experience in this area. How are things like this usually done?
Clarifying question now based on some answers:
The thing which is most unclear to me is how client-server communication is usually handled. Is client and server usually using sockets, caring about details like IP addresses, ports or NAT traversal? Or are there some common frameworks and patters, which would make this transparent, and make client-server messaging or procedure calling easy? Any examples or good starting points for this? Are there some common techniques how to handle the fact a single server is required to server multiple clients at the same time?
To use c# on Linux you will need to use Mono. This is an open source implementation of the CLR specification.
Next you need to decide on how to communicate between server and client, from the lowest level of just opening a TCP/IP socket and sending bits up and down, to .Net remoting, to WCF, to exposing webservices on the server. I do not know how compleat WCF implementation is on mono, also I think you may have issue with binary remoting between mono and MS .Net .
I would suggest RPC style WebServices offer a very good solution. WebServices also have the advantage of alowing clients from other platforms to connect easily.
EDIT
In response to the clarification of the question.
I would suggest using mono/ASP.NET/WebServices on the server, if you wish to use c# on both server and client.
One assumption I have made is that you can do a client pull model, where every message is initiated by the client. Using another approach could allow the server to push events to the client. Given the client has the ability to pole the server regularly I don't consider this much of a draw back but it may be depending on the type of application you are developing.
Mono allow execution of c# (compiled to IL) on a Linux box. Mono ASP.NET allows you to use the standard ASP.NET and integrate into Apache see http://www.mono-project.com/ASP.NET and finally WebServices allow you to communicate robustly in a strongly typed manner between you client and your server.
Using this approach negates most of the issues raised in your clarification and makes them someone else's problem.
Sockets/SSL - is taken care of by standard .Net runtime on the client and Apache on the server.
IPAddress/ports/NAT traversal - Is all taken care of. DNS look up will get the servers IP. Open socket will allow the server to respond through any firewall and NAT setup.
Multiple Clients - Apache is built to handle multiple clients processing at the same time as is ASP.NET, so you should not encounter any problems there.
As many have already mentioned there are a number of thing that you have mentioned which are going to cause you pain. I'm not going to go into those, instead I will answer your original question about communication.
The current popular choice in this kind of communication is web services. These allow you to make remote calls using the HTTP protocol, and encoding the requests and responses in XML. While this method has its critics I have found it incredibly simple to get up and running, and works fine for nearly all applications.
The .NET framework has built in support for web services which can definitely be called by your client. A brief look at the mono website indicates that it has support for web services also, so writing your server in C# and running it under mono should be fine. Googling for "C# Web Service Tutorial" shows many sites which have information about how to get started, here is a random pick from those results:
http://www.codeguru.com/Csharp/Csharp/cs_webservices/tutorials/article.php/c5477
have a look at Grasshopper:
"With Grasshopper, you can use your favorite development environment from Microsoft® to deploy applications on Java-enabled platforms such as Linux"
Or see here
The ideea is to convert your app to Java and then run it on Tomcat or JBoss.
Another approach: use the Mod_AspDotNet module for Apache, as described here.
This Basic Client/Server Chat Application in C# looks like a kind of example which might be a starting point for me. Relevant .NET classes are TcpClient and TcpListener

How to create an IM bot with C#

Is there an easy way to create an IM bot on multiple im networks (aim, gtalk, yim, etc) that can accept and interpet specific commands sent to it to perform a server related task?
Lets say for instance I have a website for managing an rss feed. I want to send a command to an IM bot to add another feed to my collection. the IM bot would associate my screen name with my account from prior setup on the website.
I have done some internal bots for my company using the XMPP (Jabber) protocol, I've used the agsXMPP SDK and the Jabber.NET client libraries, I was looking for APIS to work with YIM, AIM and Windows Live Messenger but I've found only COM exposed APIS, nothing for .NET...
But an idea comes to my mind, with the XMPP Protocol you can configure a local server with IM Gateways, that allow users to access networks using other protocols through your server
I use eJabberd, you can install a variety of transport gateways to connect with other IM protocols (AIM, MSN, ICQ, GTalk...
To GTalk you can connect directly using the libraries I mention...
A sample ICQ gateway:
The short answer to this question is yes this can be done relitivly easily. Sedning and receiving IMs sending, receiving and interpreting requests from the network you wish to communicate on and there are libraries available for each of the major IM protocols to make this easier.
For messenger you can try the DotMsn library, I have used it in the past but at that time it was still quite new and I have not used it since so I can't vouch for it's quality.
Jabber uses the XMMP protocol which is an open-standard so there are bound to be plenty of client libraries available.
If I recall correctly Google Talk uses this protocol or a modified version thereof.
I dont have experience with c# but I have written one for AIM and Gtalk using PHP. http://www.imified.com/ is the best place to start if you looking for a easier way to write an IM bot.
Basically you create an account in imified.com .
Name your bot and link a script.
When ever a message is sent to the bot, imified.com automatically runs this script.
Here is a link for you get you started!
We have professional .NET/COM/VCL library for MSN/Yahoo/ICQ/AIM/GTalk/Jabber. Please take a look at http://www.imcomponents.com/ if you like.

Categories