netsend.h

来自「最近在学习directshow, Directshow实务精选的源代码」· C头文件 代码 · 共 74 行

H
74
字号

/*++

    Copyright (c) 2000-2002  Microsoft Corporation.  All Rights Reserved.

    Module Name:

        netsend.h

    Abstract:


    Notes:

--*/

#ifndef __netsend_h
#define __netsend_h

/*++
    Class Name:

        CNetSender

    Abstract:

        This class joins, leaves, and sends to the specified multicast
        group.  Creates a synchronous socket to send on.

        It does not serialize access and relies on calling software to do
        this.

--*/
class CNetSender
{
    SOCKET              m_hSocket ;                 //  socket to send on
    DWORD               m_dwPTTransmitLength ;      //  desired transmit length (max)
    WSADATA             m_wsaData ;                 //  used during initialization
    struct sockaddr_in  m_saddrDest ;

    public :

        CNetSender (
            IN  DWORD       dwMaxIOBufferLength,
            OUT HRESULT *   phr
            ) ;

        ~CNetSender (
            ) ;

        //  joins a multicast
        HRESULT
        JoinMulticast (
            IN  ULONG   ulIP,
            IN  USHORT  usPort,
            IN  ULONG   ulNIC,
            IN  ULONG   ulTTL = 1
            ) ;

        //  leaves the multicast; can safely be called if we're not part of
        //  a multicast
        HRESULT
        LeaveMulticast (
            ) ;

        //  send; synchronous operation
        HRESULT
        Send (
            IN  BYTE *  pbBuffer,
            IN  DWORD   dwLength
            ) ;
} ;

#endif  //  __netsend_h

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?