M
M Maloney
Hey all,
I currently have a working concurrent server and client program,
wher the client requests the time, and the thread handling the client
replies.
Now I want to replace the time of day request with a binary
protocol where the client can do 3 things: 1. authenticate me, 2.
alert the server that I have contacted him/her, or am away from my
terminal, and 3. display my message to the user
Of course this should also allow the server to: 1. authentication
accepted/rejected. 2. send status of user at sever (away/available),
and 3. display my message to the user
this is the format of the protocol headers:
type (8 bits), status (8 bits), length (16 bits) = 32 bits
data (variable)
Types for Client are 0 = authenticate, 1 = alert_status 2 =
set_message
Types for server are: 3 = authenticate, 1 = alert_status, 2 =
set_message
And length is the length of the data field in bytes.
Status types are: available = 1, away = 0, authentication_OK = 2,
authentication_FAIL = 3
This is all well and good, however my problem is that I don't know
how to start with the protocol format. Do I send the protocol over? Do
i convert the numbers to binary first? What is the actual thing I send
over, a packet or just a message?
Thanks for any help, appreciate it.
I currently have a working concurrent server and client program,
wher the client requests the time, and the thread handling the client
replies.
Now I want to replace the time of day request with a binary
protocol where the client can do 3 things: 1. authenticate me, 2.
alert the server that I have contacted him/her, or am away from my
terminal, and 3. display my message to the user
Of course this should also allow the server to: 1. authentication
accepted/rejected. 2. send status of user at sever (away/available),
and 3. display my message to the user
this is the format of the protocol headers:
type (8 bits), status (8 bits), length (16 bits) = 32 bits
data (variable)
Types for Client are 0 = authenticate, 1 = alert_status 2 =
set_message
Types for server are: 3 = authenticate, 1 = alert_status, 2 =
set_message
And length is the length of the data field in bytes.
Status types are: available = 1, away = 0, authentication_OK = 2,
authentication_FAIL = 3
This is all well and good, however my problem is that I don't know
how to start with the protocol format. Do I send the protocol over? Do
i convert the numbers to binary first? What is the actual thing I send
over, a packet or just a message?
Thanks for any help, appreciate it.