小弟我刚接触ACE,有个练习用到一个ACE_Time_Value类,我想可能是计时器吧!想是编译出错,请问我应该加入那个头文件,谢谢,练习如下:
// lesson6.cpp : Defines the entry point for the console application.
//#include "stdafx.h"
#include <iostream>
#include <string.h>
#include "ace/Log_Msg.h"
#include "ace/INET_Addr.h"
#include "ace/SOCK_Connector.h"
#include "ace/SOCK_Stream.h"
using namespace std;
using std::cin;int ACE_TMAIN(int argc, ACE_TCHAR *[])
{
ACE_INET_Addr srvr;//(80,ACE_LOCALHOST);
srvr.set(80,ACE_LOCALHOST);
ACE_SOCK_Stream peer;
ACE_SOCK_Connector connection;
ACE_Time_Value timeout;//就是这个,这里有错误
if(connection.connect(peer,srvr)==-1)
cout<<"连接失败,请重试"<<endl;
int bc;
char buf[200];
peer.send_n("uptime\n",7);
bc = peer.recv(buf,sizeof(buf));
write(1,buf,bc);
peer.close();
cout<<endl;
return 0;
}