defines a network connection descriptor. MySQL uses a fairly complex
protocol on top of the one already provided by the operating system for
client/ server communication. This structure lies at the core of the
The protocol defines its own packet format. A packet can send a command, a message, or a block of data. Packets can be compressed, or transmitted over the SSL layer.
All network communication functions use
NET one way or the other, usually by accepting
it as an argument. Becoming familiar with the members of NET is a major
step toward understanding the client/server communication
NET is a rather small
structure, which permits us to cover it in its entirety. It is defined
in include/mysql_com.h. The same definition is also
used by the client library, which is written in
C. This would exclude any possibility for
NET to have any methods. However,
there are a number of functions that accept
NET* as an argument, which will be covered in
Table 3-2 lists the NET members.
Table 3-2. Members of the NET class
Low-level network I/O socket descriptor. V stands for virtual. The VIO abstraction was originally created to support SSL. Now it is also used to support Windows shared memory and named pipe connections. It also facilitates cross-platform porting in many other ways.
Start of the data buffer.
End of the data buffer.