|
楼主 |
发表于 2008-7-31 15:53:45
|
显示全部楼层
这样写可以吗?
ifstream i;
i.open("ACE.dll");
char buffer[1024];
while(!i.eof())
{
printf("发送中。。。。");
i.read(buffer,1024);
client_stream_.send_n(buffer,1024, 0);
}
i.close();
if (client_stream_.close () == -1)
ACE_ERROR_RETURN ((LM_ERROR,"(%P|%t) %p\n","close"),-1);
接收:
ofstream out;
out.open("ACE1.dll");
char buffer[1024];
while(new_stream_.recv_n(buffer, 1024, 0)!=-1)
{
printf("接收中。。。");
out.write(buffer,1024);
}
out.close();
printf("接收完毕");
if (new_stream_.close () == -1)
ACE_ERROR ((LM_ERROR, "%p\n", "close"));
return 0; |
|