This Java APP is to make a CHAT with multiple users. We use ServerSocket class and Socket to make the connection. the use a Worker to handle multiple connections. We use Logback Classic & core module. Apache Commons Lang for implement login and logoff commands.
- Create chat Server. handle multiple connections.
- Handling User Presence (Online & Offline Status)
We have User & Server for use the chat.
-
User communicate to Server
- user can log or logoff
- status of the user
-
The Server communicate to User
- communicate to other user come online or offline
-
Users communicate to another Users
- users can send direct messages to other users
- users can send group messages (the groups messages work with a #)
- users can broadcast messages
Commands that use for login or logoff:
login <user> <password>
logoff
msg <user> body....
guest: "msg jim Hello World" <--- sent
jim: "msg guest Hello World" <--- recv
#topic <--- chatroom / group chat
join #topic
leave #topic
send msg #topic body---
recive msg #topic:<login> body ...
Commons Lang https://commons.apache.org/proper/commons-lang/
ServerSocket https://docs.oracle.com/javase/8/docs/api/java/net/ServerSocket.html Socket https://docs.oracle.com/javase/8/docs/api/java/net/Socket.html