[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [ns] How to use recv() command in NS



You may want to have a look at Marc Greis's tutorial, chapter VII, if you
are trying to implement your own recv function....

Hope it helps,

-chen xuan

On Mon, 11 Jun 2001, Huan Pham wrote:

> recv and send conmands are defined for the Application Class.  send
> command is easy to implement, such as:
> 
> ...
> set ftp_src [new Application/FTP]
> $ftp_src attach-agent $tcp
> $ns at 0.1 "$ftp_src send 10000"
> ...                  ^^^^^^^^^^
> 
> Could anyone can show me how to use the recv command, in this scenario.
> I really need to use this command. Thank you very much.
> 
> 
> 
> 
> Here is how the two commands are defined in NS
> 
> 
> class Application : public Process {
> public:
>  Application();
>  virtual void send(int nbytes);
>  virtual void recv(int nbytes);
>  virtual void resume();
> 
> protected:
>  virtual int command(int argc, const char*const* argv);
>  virtual void start();
>  virtual void stop();
> 
>  Agent *agent_;
>  int enableRecv_;  // call Tcl recv or not
>  int enableResume_;  // call Tcl resume or not
> };
> 

-- 
Xuan Chen
USC/ISI