A session is the time between the opening and closing of the connection between the client and the server.
The following list describes the most important fields in this data structure:
sn->client— Pointer to a pblock containing information about the client such as its IP address, DNS name, or certificate.
sn->csd— Platform-independent client socket descriptor. This pointer is passed to the routines for reading from and writing to the client.
The Session data structure holds variables that apply to a client, regardless of the requests being sent.
typedef struct { /* Information about the remote client */ pblock *client; /* The socket descriptor to the remote client */ SYS_NETFD csd; /* The input buffer for that socket descriptor */ netbuf *inbuf; } Session; |
The following list describes the most important fields in the Session data structure:
client — Pointer to a pblock containing information about the client such as its IP address, DNS name, or SSL certificate. The ip parameter contains the client's IP address. Do not modify the contents of this pblock.
csd — The platform-independent client socket descriptor used to communicate with the client. This descriptor can be passed to routines such as net_write to send output to the client.
inbuf — Pointer to the input buffer for the client socket descriptor. This pointer can be passed to routines such as netbuf_grab or netbuf_getc to receive input from the client.
The Session NSAPI data structure cannot be used concurrently by multiple threads. Do not retain any reference to a Session or its contents after processing of the current request is complete.