Chat System
This is a simple "chat" application, using the C/S architectural model.
Usage
# server defaults to 4444
java -jar chatserver.jar
# OR accept custom port with flag -p
java -jar chatserver.jar -p 6666
# client takes hostname as first arg and defaults to 4444
java -jar chatclient.jar localhost
# OR takes hostname as first arg AND accepts port argument with flag -p
java -jar chatclient.jar localhost -p 6666
Commands
#identitychange [new identity]
#join [room]
#who [room]
#list
#createroom [room]
#deleteroom [room]
#quit
Protocols
Please go here for more information of protocols.
Wire
Types
identity: [a-zA-Z0-9]{3,16}
string: char[]
i32: int
C2S
identitychange
{
"type": "identitychange",
"identity": identity
}
join
{
"type":"join",
"roomid": string
}
who
{
"type":"who",
"roomid": string
}
list
{
"type":"list"
}
createroom
{
"type":"createroom",
"roomid": string
}
delete
{
"type":"delete",
"roomid": string
}
quit
{
"type":"quit"
}
message
{
"type":"message",
"content": string
}
S2C
newidentity
{
"type":"newidentity",
"former": identity,
"identity": identity
}
roomchange
{
"type":"roomchange",
"identity": identity,
"former": identity,
"roomid": string
}
roomcontents
{
"type":"roomcontents",
"roomid": string,
"identities": [identity],
"owner": identity
}
roomlist
{
"type":"roomlist",
"rooms": [{"roomid": string, "count": i32}]
}
message
{
"type":"message",
"identity": identity,
"content": string
}