最近学习了Decload的关于NS3中socket的使用,想要稍作修改,发现自己实在是基础很不扎实,需要补补啊!
/* -*- 20160328 wsy 继续尝试 -*- */
/*
* 实现了client给server发送数据,server接收到后发回去给client,但当时
* client的socket已经关闭,无法正常接收
*
* 回调函数类似中断,用于检测对应socket有没有接收到内容,
* 接收到则跳进回调函数recvCallback中
*
*疑问:能不能在回调函数里再调用回调函数
*
*
*/
#include <fstream>
#include <string>
#include “ns3/core-module.h”
#include “ns3/network-module.h”
#include “ns3/applications-module.h”
#include “ns3/mobility-module.h”
#include “ns3/config-store-module.h”
#include “ns3/wifi-module.h”
#include “ns3/internet-module.h”
#include “ns3/netanim-module.h”
using namespace ns3;
Ptr<Socket> server;
Ptr<Socket> client;
//Ptr<Packe