[DPI][TCP] linux API的接口如何控制urgent包的收发

做DPI,写协议栈的时候,处理到了urgent数据包。突然好奇应用层是如何控制发出urgent包的呢?而接收端又是如何知道,接受到了urgent包的呢?

man 7 tcp,中有如下一段:

TCP supports urgent data.  Urgent data is used to signal the receiver that some important message is part of the data stream and that it should be processed as soon as possible.
To send urgent data specify the MSG_OOB option to send(). When urgent data is received, the kernel sends a SIGURG signal to the process or process group that has been set as
the socket "owner" using the SIOCSPGRP or FIOSETOWN ioctls (or the POSIX.-specified fcntl() F_SETOWN operation). When the SO_OOBINLINE socket option is enabled, urgent data
is put into the normal data stream (a program can test for its location using the SIOCATMARK ioctl described below), otherwise it can be received only when the MSG_OOB flag is
set for recv() or recvmsg().
上一篇:Java8 函数式接口-Functional Interface


下一篇:java8函数式接口(Functional Interface)