![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Newbie
Join Date: Nov 2005
Posts: 2
Rep Power: 0
![]() |
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. ![]() |
|
|
|
|
#2 |
|
Expert Programmer
Join Date: Aug 2005
Location: Rotterdam, the Netherlands
Posts: 942
Rep Power: 4
![]() |
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. |
|
|
|
|
#3 |
|
Troll
Join Date: Apr 2005
Location: Texas
Posts: 732
Rep Power: 4
![]() |
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.
__________________
MD5(sig) = bcef75433db02e9ad9bf81d6f7c5c270 |
|
|
|
|
#4 |
|
Hobbyist Programmer
|
"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
__________________
Hoes telling me to calm down but I'm like fuck that shit!
|
|
|
|
|
#5 |
|
Professional Programmer
|
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.
|
|
|
|
|
#6 |
|
Troll
Join Date: Apr 2005
Location: Texas
Posts: 732
Rep Power: 4
![]() |
@andro, what's the difference?
__________________
MD5(sig) = bcef75433db02e9ad9bf81d6f7c5c270 |
|
|
|
|
#7 |
|
Professional Programmer
|
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. |
|
|
|
|
#8 | |
|
Troll
Join Date: Apr 2005
Location: Texas
Posts: 732
Rep Power: 4
![]() |
Quote:
__________________
MD5(sig) = bcef75433db02e9ad9bf81d6f7c5c270 |
|
|
|
|
|
#9 |
|
haward2010
Join Date: Oct 2007
Posts: 10
Rep Power: 0
![]() |
Re: Instant Messaging System Final Year Project
|
|
|
|
|
#10 | |
|
Resident Grouch
![]() ![]() ![]() ![]() ![]() ![]() Join Date: Jun 2005
Posts: 6,453
Rep Power: 10
![]() |
Re: Instant Messaging System Final Year Project
Quote:
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code. Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|