[j-sim-users] Application

Paul Vicenti pvicenti at gmail.com
Thu Jan 25 15:51:44 CST 2007


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


More information about the j-sim-users mailing list