956
Chapter 46
(
SERVER_KEY
), and defines the formats of the messages to be passed between the cli-
ent and the server.
The requestMsg structure defines the format of the
request sent from the client
to the server. In this structure, the mtext component consists of two fields: the iden-
tifier of the client’s message queue and the pathname of the
file requested by the
client. The constant
REQ_MSG_SIZE
equates to the combined size of these two fields
and is used as the msgsz argument in calls to msgsnd() using this structure.
The responseMsg structure defines the format of the response messages sent
from the server back to the client. The mtype field is
used in response messages to
supply information about the message content, as defined by the
RESP_MT_*
constants.
Listing 46-7: Header file for
svmsg_file_server.c
and
svmsg_file_client.c
–––––––––––––––––––––––––––––––––––––––––––––––––––––––
Chia sẻ với bạn bè của bạn: