- if(!dict_socket) dict_socket = xbt_dict_new();
-
- PacketSinkHelper sink ("ns3::TcpSocketFactory",
- InetSocketAddress (Ipv4Address::GetAny(),
- port_number));
- sink.Install (dst);
- Ptr<Socket> sock = Socket::CreateSocket (src,
- TcpSocketFactory::GetTypeId());
-
- MySocket *mysocket = new MySocket();
- mysocket->totalBytes = totalBytes;
- mysocket->remaining = totalBytes;
- mysocket->bufferedBytes = 0;
- mysocket->sentBytes = 0;
- mysocket->finished = 0;
- mysocket->action = action;
- xbt_dict_set(dict_socket,(const char*)&sock, mysocket,NULL);
- sock->Bind(InetSocketAddress(port_number));
- Simulator::Schedule (Seconds(start),&StartFlow, sock, addr, port_number);