Results 1 to 5 of 5

Thread: create a instant messenger type application

  1. #1

    Thread Starter
    Fanatic Member d2005's Avatar
    Join Date
    Aug 2005
    Location
    ireland
    Posts
    620

    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
    it works 60% of the time, all the time.

  2. #2
    Fanatic Member
    Join Date
    May 2001
    Posts
    837

    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.
    The human brain cannot hold all of the knowledge that exists in this world, but it can hold pointers to that knowledge.

  3. #3
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    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.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  4. #4

    Thread Starter
    Fanatic Member d2005's Avatar
    Join Date
    Aug 2005
    Location
    ireland
    Posts
    620

    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.
    it works 60% of the time, all the time.

  5. #5
    I'm about to be a PowerPoster!
    Join Date
    Jan 2005
    Location
    Everywhere
    Posts
    13,647

    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width