This is a simple "chat" application, using the C/S architectural model.
# 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
#identitychange [new identity]
#join [room]
#who [room]
#list
#createroom [room]
#deleteroom [room]
#quit
Please go here for more information of protocols.
identity: [a-zA-Z0-9]{3,16}
string: char[]
i32: int
{
"type": "identitychange",
"identity": identity
}
{
"type":"join",
"roomid": string
}
{
"type":"who",
"roomid": string
}
{
"type":"list"
}
{
"type":"createroom",
"roomid": string
}
{
"type":"delete",
"roomid": string
}
{
"type":"quit"
}
{
"type":"message",
"content": string
}
{
"type":"newidentity",
"former": identity,
"identity": identity
}
{
"type":"roomchange",
"identity": identity,
"former": identity,
"roomid": string
}
{
"type":"roomcontents",
"roomid": string,
"identities": [identity],
"owner": identity
}
{
"type":"roomlist",
"rooms": [{"roomid": string, "count": i32}]
}
{
"type":"message",
"identity": identity,
"content": string
}