create a instant messenger type application
hi
i am looking into the possibility of creating a simple instant messaging service.
i am still reading up on different aspects before i start lol
but should the program be a windows application that accesses the internet
or
should it be a webservice
or
should it be an asp.net application
are there any examples out there of creating such a program
please forgive my ignorance
Re: create a instant messenger type application
I suppose it could be a web app, but look at the down sides. There are no ways to refresh the users screen when they recieve a message, the best you can do is refreshing the web page every 5 seconds or so just to see if the other person has said anything. That would also require a round trip to the server and possibly lots of conversation text either being stored on the server, or transported back and forth every 5 seconds in this example.
I believe web services are also stateless, like web apps. So you would need to call the web service every 5 seconds to see if any new messages came in.
Your best bet is a windows app. If each user logs in by establishing a socket connection to the server, then updates about incoming messages can be sent instantly. Also, the conversation data would be held on each users computer and would not have to take up memory on the server or be taken round trip during a refresh.
Re: create a instant messenger type application
The 2003 101 Samples contains a client/server chat application as an example of using Sockets. I don't know about 2005 but you can always convert the 2003 project.
Re: create a instant messenger type application
i can run the example fine on my machine
now i want to test it over the internet
i think the code i am having trouble with is
client = New TcpClient("xx.xx.xxx.xx", PORT_NUM)
this is code from the client where the client wants to connect to the server,
how can i specify the servers ip. the above does not seem to work.
Re: create a instant messenger type application
Quote:
Originally Posted by DNA7433
I suppose it could be a web app, but look at the down sides. There are no ways to refresh the users screen when they recieve a message, the best you can do is refreshing the web page every 5 seconds or so just to see if the other person has said anything. That would also require a round trip to the server and possibly lots of conversation text either being stored on the server, or transported back and forth every 5 seconds in this example.
Have a look at Meebo. They make extensive use of Ajax to get around the stateless problem. The concept is essentially to open a persistent connection to the server using the XMLHttpRequest Javascript object. This means the server can communicate to the client whenever required, the connection is simply flushed and recycled. It is very bandwidth-efficient.
Basically it's possible either way however the principles and knowledge required are quite different. Javascript can be a tricky language if you are not already skilled in using a strongly typed language.
Also, as a technical point - ASP.NET/web service/web site are all basically the same. The only difference is a web service is not generally accessed through the graphical front end of a web browser, whereas a website is.