Created
February 22, 2011 21:09
-
-
Save cdecker/839394 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package net.bitdroid.monitor; | |
import java.io.IOException; | |
import java.net.Socket; | |
import java.net.UnknownHostException; | |
import net.bitdroid.network.ThreadedBitcoinReactor; | |
import net.bitdroid.network.BitcoinEventListener; | |
import net.bitdroid.network.Event; | |
public class BitDroidMonitor { | |
public static void main(String args[]) throws UnknownHostException, IOException{ | |
Socket s = new Socket("localhost", 8333); | |
ThreadedBitcoinReactor client = new ThreadedBitcoinReactor(s); | |
client.addListener(new BitcoinEventListener() { | |
public void eventReceived(Event event) { | |
System.out.println("Received: " + event.getSubject().toString() + " of type " + event.getType()); | |
} | |
public void messageSent(Event event) { | |
System.out.println("Sent: " + event.getSubject().toString() + " of type " + event.getType()); | |
} | |
}); | |
client.run(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment