Skip to content

Hitansh-Thakur/JavaChatApp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 

Repository files navigation

Lessons Learned

  1. Object Serialization: Understand how to serialize and deserialize objects in Java using ObjectOutputStream and ObjectInputStream.

  2. Stream Order: Remember the order of stream creation:

"Always create ObjectOutputStream before ObjectInputStream".

This is crucial to avoid EOFException when reading from the input stream.

  1. Avoid mixing ObjectOutputStream and DataOutputStream.:use one or the other.

  2. Different Types of Streams: Familiarize with different types of streams: FileInputStream, FileOutputStream, ObjectInputStream, and ObjectOutputStream.

  3. Only create single ObjectOutput and ObjectInput stream per Socket: results in StreamCorruptedException.

  4. Closing Streams closes Sockets

  5. Sync between Client and Server: Understand the importance of synchronization between client and server when sending and receiving objects. The server should be ready to receive an object before the client sends it.

TODOs:

  • Smooth msg exchange between client and server.

  • Multiple clients support.

    • add a new thread for each client.
    • store username and out streams in a map.
  • support to send files over the network.

  • add a database to store user credentials and messages.

  • add user authentication.

  • add encryption to the messages.

  • add a GUI to the client.

About

TCP sockets multiple clients connect and exchange messages securely.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages