[j-sim-users] Application

Hung-ying Tyan tyanh at ieee.org
Sat Jan 27 03:39:22 CST 2007


You need to create the entire node structure.  Refer to the example at
http://www.j-sim.org/drcl.inet/ex1.html, and the example done purely
in Java at http://www.j-sim.org/comparison.html#ex1.

HT

On 1/26/07, Paul Vicenti <pvicenti at gmail.com> wrote:
> Hello,
> I want to use j-sim to simulate a network where each end node
> implements a web service.
> I saw that there is a small ftp implemented and I tried to start from there.
> I have to do all the model in java so I tried to start doing a working
> example with both ftp and ftpd. I found the script test_ftp.tcl and I
> re-wrote.
> The problem is that I get this exception while running it:
>
> drcl.comp.SendReceiveException: sendreceive()| did not get reply from
> ?/null/ftp/down at .sendReceive(), data=BYTE_STREAM_QUERY
>         at drcl.comp.Port.sendReceive(Port.java:1098)
>         at drcl.comp.lib.bytestream.ByteStreamPeer.send(ByteStreamPeer.java:219)
>         at drcl.comp.lib.bytestream.ByteStreamPeer$2.write(ByteStreamPeer.java:146)
>         at java.io.DataOutputStream.writeLong(Unknown Source)
>         at drcl.inet.application.ftp._start(ftp.java:92)
>         at drcl.comp.TaskSpecial.execute(TaskSpecial.java:100)
>         at drcl.sim.event.SEThread.run(SEThread.java:291)
>
> The code is below:
>
> String SOURCE_FILE = "test.log";
> String DEST_FILE = "test-dest.log";
>
> drcl.comp.Component test_ = new Component();
>
> drcl.inet.application.ftpd ftpd = new drcl.inet.application.ftpd("ftpd");
> ftpd.setup(DEST_FILE, 1024);
> drcl.inet.application.ftp ftp = new drcl.inet.application.ftp("ftp");
> ftp.setup(SOURCE_FILE, 1024);
>
>                         ftp.getPort("up").connect(ftpd.getPort("down"));
> ftp.setDebugEnabled(true);
> ftp.setDirectOutputEnabled(true);
> ftpd.setDebugEnabled(true);
> ftpd.setDirectOutputEnabled(true);
>
> test_.addComponent(ftp);
> test_.addComponent(ftpd);
>
> drcl.comp.ACARuntime rt_ = new drcl.sim.event.SESimulator();
> drcl.comp.Util.setRuntime(test_, rt_);
>
> rt_.stop();
> rt_.stopAt(100);
>
> nodes = new Object[2];
>
> nodes[1] = ftp;
> nodes[0] = ftpd;
>
> drcl.comp.Util.operate(nodes, "start");
> rt_.resume();
>
>
> Thanks on advance,
> paul
> _______________________________________________
> j-sim-users mailing list
> j-sim-users at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/j-sim-users
>


More information about the j-sim-users mailing list