![]() |
Instant Messaging System Final Year Project
Hi Everyone
I am planning to build an instant messaging system for my final year computer science project using java sockets. I really need ideas on how i can go about implementing the system. I would really appreciate any help i get, thanks. :) |
Very basic idea:
Well, you have a server computer, which runs the serverprogram for your protocol, and a database to save all the usernames in. The serverprogram receives all the messages, and sends them to the computers which need to receive the message. Then you have the client of course, which connects to the server. |
The client side is easy. Create a class for a server link that allows you to Login, SendMessage, Tick (call it every so many milliseconds to check your sockets, or alternatively spawn a thread), and Disconnect with events such as LoginDone, Disconnected, and MessageReceived.
For the server side, have a class for a connected client that, in the constructor, takes a socket. It should have a tick method similar to the server link class. Methods would include SendMessage (that additionally takes a From parameter) and Disconnect. Events would include LoginAttempt, MessageReceived, and Disconnected. When your listening socket has an incoming connection, accept it and use the returned socket to create a client link object. Set up your event handlers and lastly add it to your client list. The MessageReceived event handler simply enumerates the list to find a matching destination and calls SendMessage. LoginAttempt should return a success or error code to the client and if it was an error proceed to call disconnect. Disconnected is obvious. |
"Sams Teach Yourself Java 2 in 21 Days" has a great example of client/server apps. and a whole chapter on 'Communicating Across The Internet', maybe theres a e-book out there somewhere you could download
|
Rather than an IM system, I would suggest a client/server based chat instead. Just a thought. Plus, there are plenty of client/server chat code examples available.
|
@andro, what's the difference?
|
Availability of example code.
For an IM system, you need a central server that allows multiple user authentication and proper threading/routing between client's for sending IM's. All in all it's just more complicated. A client/server chat, on the other hand, is pretty straightforward. And like I said, there's TONS of example code floating around out there. Also, it seems like this is your first stab at sockets and what-not in Java. Client/server chat seems to be a pretty standard way to introduce the concepts and api from what I've seen. If you have the time to learn about sockets in Java, and then to design an IM system, by all means do it. It would admittedly be a little cooler than the client/server chat. |
Quote:
|
Re: Instant Messaging System Final Year Project
If you need readymade project then contactme at hk_pamnani@yahoo.co.in
Quote:
|
Re: Instant Messaging System Final Year Project
Quote:
|
| All times are GMT -5. The time now is 5:41 PM. |
Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC