Java implementation of chatting application