github.com/psiphon-inc/goarista@v0.0.0-20160825065156-d002785f4c67/dscp/listen.go (about)

     1  // Copyright (C) 2016  Arista Networks, Inc.
     2  // Use of this source code is governed by the Apache License 2.0
     3  // that can be found in the COPYING file.
     4  
     5  // Package dscp provides helper functions to apply DSCP / ECN / CoS flags to sockets.
     6  package dscp
     7  
     8  import (
     9  	"net"
    10  )
    11  
    12  // ListenTCPWithTOS is similar to net.ListenTCP but with the socket configured
    13  // to the use the given ToS (Type of Service), to specify DSCP / ECN / class
    14  // of service flags to use for incoming connections.
    15  func ListenTCPWithTOS(address *net.TCPAddr, tos byte) (*net.TCPListener, error) {
    16  	return listenTCPWithTOS(address, tos)
    17  }