ace开发环境 用来开发网络程序 其运用了设计模式、多平台、C++等多种知识

源代码在线查看: fifo-msg-server.cpp

软件大小: 11862 K
上传用户: newyearday
关键词: ace 开发环境 网络 程序
下载地址: 免注册下载 普通下载 VIP

相关代码

				// $Id: FIFO-Msg-server.cpp 63403 2005-01-21 16:04:05Z jwillemsen $								#include "ace/FIFO_Recv_Msg.h"				#include "ace/Log_Msg.h"				#include "ace/OS_NS_stdio.h"				#include "ace/OS_NS_unistd.h"				#include "ace/OS_NS_stdlib.h"				#include "ace/OS_NS_stropts.h"				#include "ace/OS_main.h"								ACE_RCSID(FIFO_SAP, FIFO_Msg_server, "$Id: FIFO-Msg-server.cpp 63403 2005-01-21 16:04:05Z jwillemsen $")								#if defined (ACE_HAS_STREAM_PIPES)								int				ACE_TMAIN (int, ACE_TCHAR *[])				{				  ACE_OS::unlink (ACE_DEFAULT_RENDEZVOUS);				  ACE_FIFO_Recv_Msg server (ACE_DEFAULT_RENDEZVOUS);				  char buf[BUFSIZ];				  ACE_Str_Buf msg (buf, 0, sizeof buf);				  int flags = MSG_ANY;				  int band = 0;				  int n;								  while ((n = server.recv (&band, &msg, (ACE_Str_Buf *) 0, &flags)) >= 0)				    {				      if (msg.len == 0)					break;				      else					ACE_DEBUG ((LM_DEBUG, "%4d (%4d): %*s",						    msg.len, band, msg.len, msg.buf));				      flags = MSG_ANY;				      band = 0;				    }								  if (n == -1)				    ACE_OS::perror ("recv"), ACE_OS::exit (1);								  return 0;				}				#else				int ACE_TMAIN (int, ACE_TCHAR *[])				{				  ACE_ERROR ((LM_INFO,				              ACE_TEXT ("This feature is not supported\n")));				  return 0;				}				#endif /* ACE_HAS_STREAM_PIPES */							

相关资源