NS3回调问题

  • Post author:
  • Post category:其他


最近学习了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



版权声明:本文为ziseshamo102原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。