Implemented sending messages (and fixed a few bugs on the way)

This closes issue #3
This commit is contained in:
2015-05-29 13:17:00 +02:00
parent 3d618ffeb4
commit 274c16b748
29 changed files with 357 additions and 138 deletions

View File

@ -120,6 +120,7 @@ public class Connection implements Runnable {
+ msg.getPayload().getCommand());
}
}
if (socket.isClosed()) state = DISCONNECTED;
} catch (SocketTimeoutException ignore) {
if (state == ACTIVE) {
sendQueue();
@ -160,7 +161,7 @@ public class Connection implements Runnable {
ctx.getInventory().storeObject(objectMessage);
} catch (InsufficientProofOfWorkException e) {
try {
File f = new File(System.getProperty("user.home")+"/jabit.error/" + objectMessage.getInventoryVector() + ".inv");
File f = new File(System.getProperty("user.home") + "/jabit.error/" + objectMessage.getInventoryVector() + ".inv");
f.createNewFile();
objectMessage.write(new FileOutputStream(f));
} catch (IOException e1) {