Figure 1

Figure 2

Figure 3

Figure 4

Figure 5

Figure 6

Figure 7

Logical structure of virtual port
| content | Function |
|---|---|
| PortID | Port ID (receive/send, the same below) |
| MsgName | Subject information |
| MsgMaxSize | Maximum length of buffered message |
| MsgMaxNum | Maximum number of buffered messages |
| MsgQueueID | Message queue ID |
| DestMsgQueueID | The ID of the buffer message queue of the receiving port bound to the sending port (sending) |
| PsudoID | Virtual port user configuration number |
| DevHdr | Device handle of the underlying driver port |
| EmptyFlag | Whether the message buffer is empty |
| IsAssig | Whether to bind with the sending port (receive) |
Interface function and corresponding function
| Interface function | Function |
|---|---|
| socket( ) | Create a socket descriptor |
| bind( ) | Bind the socket to a specific TCP port |
| listen( ) | Listening socket |
| connect( ) | Send a connection request to the server (client-only) |
| accept( ) | Accept connection request (server exclusive) |
| send( ) | send data |
| recv( ) | Receive data |
| close( ) | Close socket |