-
Object Serialization: Understand how to serialize and deserialize objects in Java using
ObjectOutputStreamandObjectInputStream. -
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.
-
Avoid mixing ObjectOutputStream and DataOutputStream.:use one or the other.
-
Different Types of Streams: Familiarize with different types of streams:
FileInputStream,FileOutputStream,ObjectInputStream, andObjectOutputStream. -
Only create single ObjectOutput and ObjectInput stream per Socket: results in
StreamCorruptedException. -
Closing Streams closes Sockets
-
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.
-
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.