2011-08-17 198 views

回答

11

我搜索了一會兒,最後試圖查看Boost的源代碼。我發現這在socket_base.hpp

/// Bitmask type for flags that can be passed to send and receive operations. 
    typedef int message_flags; 

#if defined(GENERATING_DOCUMENTATION) 
    /// Peek at incoming data without removing it from the input queue. 
    static const int message_peek = implementation_defined; 

    /// Process out-of-band data. 
    static const int message_out_of_band = implementation_defined; 

    /// Specify that the data should not be subject to routing. 
    static const int message_do_not_route = implementation_defined; 
#else 
    BOOST_STATIC_CONSTANT(int, 
     message_peek = boost::asio::detail::message_peek); 
    BOOST_STATIC_CONSTANT(int, 
     message_out_of_band = boost::asio::detail::message_out_of_band); 
    BOOST_STATIC_CONSTANT(int, 
     message_do_not_route = boost::asio::detail::message_do_not_route); 
#endif 

在此基礎上,它看起來像message_peekmessage_out_of_bandmessage_do_not_route是可能的值。我會試一試,看看我能否讓他們工作。

0

這個參數是轉發到系統調用。例如在Windows中,它直接轉發到WSASend。應該在操作系統文檔中檢查param的含義:WSASend對於Windows,否則recvmsg