Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

An error occurred downloading. #16

Open
LIXUANYI opened this issue Oct 9, 2016 · 0 comments
Open

An error occurred downloading. #16

LIXUANYI opened this issue Oct 9, 2016 · 0 comments

Comments

@LIXUANYI
Copy link

LIXUANYI commented Oct 9, 2016

Hi,I have a demo.

code :
Metafile metafile = new Metafile(new BufferedInputStream(new FileInputStream("c:/saber.torrent")));
TorrentDisk tdisk = new PlainFileSystemTorrentDisk(metafile, new File("c:/"));
tdisk.init();
IncomingPeerListener peerListener = new IncomingPeerListener(59999);
peerListener.start();
Torrent torrent = new Torrent(metafile, tdisk, peerListener);
torrent.startDownload();
while (!torrent.isCompleted()) {
try {
Thread.sleep(1000);
//System.out.println("downloading....");
} catch(InterruptedException ie) {
break;
}
torrent.tick();
}

error message:
java.net.SocketException: Socket closed
at java.net.SocketInputStream.socketRead0(Native Method)
at java.net.SocketInputStream.read(SocketInputStream.java:152)
at java.net.SocketInputStream.read(SocketInputStream.java:122)
at java.io.DataInputStream.readFully(DataInputStream.java:195)
at java.io.DataInputStream.readFully(DataInputStream.java:169)
at org.bitlet.wetorrent.peer.task.MessageReceiver.execute(MessageReceiver.java:106)
at org.bitlet.wetorrent.util.thread.InterruptableTasksThread.run(InterruptableTasksThread.java:50)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant