Skip to content
Browse files

Fixed invalid message exception, added back debug printing

  • Loading branch information...
1 parent 813a0ae commit 0d0c5121c6dd89e61291552930944b4e2c34f70b @theterg theterg committed
View
2 SimpleSwarmExample/simpleswarmexample/SimpleSwarmExampleApplication.java
@@ -73,7 +73,7 @@ public void messageRecieved(Map<String, ?> payload, String fromSwarm, String fro
try {
while(true){
if (producersession != null && producersession.isConnected()){
- //producersession.send(map);
+ producersession.send(map);
}
Thread.sleep(1000);
}
View
2 ...labs.bug.swarm.client/src/com/buglabs/bug/swarm/client/impl/SwarmParticipationReader.java
@@ -104,7 +104,7 @@ public void run() {
continue;
}
//uncomment below to print all messages received by the reader
- //debugOut(line, false);
+ debugOut(line, false);
//Parse the message string into a JsonNode.
JsonNode jmessage = mapper.readTree(line);
View
7 com.buglabs.bug.swarm.client/src/com/buglabs/bug/swarm/client/impl/SwarmSessionImp.java
@@ -88,7 +88,8 @@ private void createKeepAliveThread() {
public void run() {
if (localtimestamp==timestamp){
try {
- writeOut("\r\n");
+ //writeOut("\r\n");
+ writeOut(generateOutgoingPresenceMessage(true,swarmIds));
} catch (IOException e) {
e.printStackTrace();
}
@@ -267,7 +268,7 @@ public void join(String swarmId, String resourceId) throws IOException {
*/
private void debugOut(String message, boolean out) {
if (out)
- System.out.println("["+this.getClass().getSimpleName()+"]: "+"["+this.getClass().getSimpleName()+"]: "+apiKey.substring(0, 4)+" --> "+message);
+ System.out.println("["+this.getClass().getSimpleName()+"]: "+apiKey.substring(0, 4)+" --> "+message);
else
System.out.println("["+this.getClass().getSimpleName()+"]: "+apiKey.substring(0, 4)+" <-- "+message);
}
@@ -334,7 +335,7 @@ private void writeOut(String message) throws IOException {
sendHeader();
}
- //debugOut(message, true);
+ debugOut(message, true);
//new framing requires sending a \r\n after each message.
soutput.write(Integer.toHexString(message.length()+CRLF.length()).getBytes());
soutput.write(CRLF.getBytes());
View
BIN ...s/com.buglabs.bug.swarm.client-070912.jar → ...s/com.buglabs.bug.swarm.client-071312.jar
Binary file not shown.

0 comments on commit 0d0c512

Please sign in to comment.
Something went wrong with that request. Please try again.