sender.cpp

来自「ACE自适配通信环境(ADAPTIVE Communication Enviro」· C++ 代码 · 共 54 行

CPP
54
字号
// file      : Sender.cpp// author    : Boris Kolpackov <boris@kolpackov.net>// cvs-id    : Sender.cpp,v 1.2 2005/06/17 15:36:33 boris Exp#include "ace/OS.h"#include "ace/Log_Msg.h"#include "ace/RMCast/Socket.h"#include "Protocol.h"class args {};intACE_TMAIN (int argc, ACE_TCHAR* argv[]){  try  {    if (argc < 2) throw args ();    ACE_INET_Addr addr (argv[1]);    // Turn on message loss and reordering simulation.    //    ACE_RMCast::Socket socket (addr, false, true);    Message msg;    msg.sn = 0;    for (unsigned short i = 0; i < payload_size; i++)    {      msg.payload[i] = i;    }    for (; msg.sn < message_count; msg.sn++)    {      socket.send (&msg, sizeof (msg));    }    // Keep running in case retransmissions are needed.    //    ACE_OS::sleep (ACE_Time_Value (60, 0));    return 0;  }  catch (args const&)  {    ACE_ERROR ((LM_ERROR,                "usage: %s <IPv4 multicast address>:<port>\n", argv[0]));  }  return 1;}

⌨️ 快捷键说明

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