Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Chat Passion Series

680 views

Published on

A client-server based e-chat application in Java

  • Be the first to comment

  • Be the first to like this

Chat Passion Series

  1. 1. Submitted to Submitted • Er.:Mayank by : • Naveen Moorjani (Team Sharma • Chandni Verma Leader) • Tushar Seth (Coder) (Tester)
  2. 2. Objective A JAVA Chat Application based on client-server architecture.
  3. 3. Features Allows a client to communicate with all the other clients connected to the server. Light-weight. Easy to operate ! Can add a chat room to your website in minutes.
  4. 4. Technologies used Networking Multi-threading Applets Abstract window toolkit (AWT)
  5. 5. Simplest Concept
  6. 6. Protocol – Step 1 When a user types something into their chat window, their message will be sent as a string through a DataOutputStream.private void processMessage( String message ){ try { // Send it to the server dout.writeUTF( message ); // Clear out text input field tf.setText( "" ); } catch( IOException ie ) { System.out.println( ie ); }}
  7. 7. Protocol – Step 2  When the server receives a message, through a DataInputStream, it will send this same message to all users, again as a string through a DataOutputStream.void sendToAll( String message ) { synchronized( outputStreams ) { for (Enumeration e = getOutputStreams(); e.hasMoreElements(); ) { DataOutputStream dout = (DataOutputStream)e.nextElement(); try { dout.writeUTF( message ); } catch( IOException ie ) { System.out.println( ie ); } } }}
  8. 8. Protocol – Step 3 The users will use a DataInputStream to receive the message.public void run() { try { while (true) { String message = din.readUTF(); ta.append( message+"n" ); } } catch( IOException ie ) { System.out.println( ie ); }}
  9. 9. Future prospects Multiple chat rooms. Multiple skins Multi lingual support Higher Security Protocols
  10. 10. Thanks for watching, Goodbye !

×