最新的版本ACE-5.6.8,刚从外文网上搬下,与大家分享.

源代码在线查看: sender.cpp

软件大小: 24894 K
上传用户: guozhongjiesg02
关键词: ACE 版本
下载地址: 免注册下载 普通下载 VIP

相关代码

				// file      : Sender.cpp
				// author    : Boris Kolpackov 
				// cvs-id    : $Id: Sender.cpp 80826 2008-03-04 14:51:23Z wotte $
				
				#include "ace/OS.h"
				#include "ace/Log_Msg.h"
				
				#include "ace/RMCast/Socket.h"
				
				#include "Protocol.h"
				
				class args {};
				
				int
				ACE_TMAIN (int argc, ACE_TCHAR* argv[])
				{
				  try
				  {
				    if (argc < 2) throw args ();
				
				    ACE_INET_Addr addr (argv[1]);
				
				    //FUZZ: disable check_for_lack_ACE_OS
				    ACE_RMCast::Socket socket (addr, false);
				    //FUZZ: enable check_for_lack_ACE_OS
				
				    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 (50, 0));
				
				    return 0;
				  }
				  catch (args const&)
				  {
				    ACE_ERROR ((LM_ERROR,
				                "usage: %s :\n", argv[0]));
				  }
				
				  return 1;
				}
							

相关资源