zoukankan      html  css  js  c++  java
  • [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(2).  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.1-specified fcntl(2) 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(2) or recvmsg(2).
  • 相关阅读:
    多线程中注意事项
    多线程实现第三种方式
    线程池《一》
    线程组
    线程间通信注意的问题
    互斥锁
    多个线程通信的问题
    二个线程间的通信
    死锁产生的原理
    线程安全问题
  • 原文地址:https://www.cnblogs.com/hugetong/p/8398886.html
Copyright © 2011-2022 走看看