com.google.bitcoin.core
Class IrcDiscovery

java.lang.Object
  extended by com.google.bitcoin.core.IrcDiscovery
All Implemented Interfaces:
PeerDiscovery

public class IrcDiscovery
extends Object
implements PeerDiscovery

IrcDiscovery provides a way to find network peers by joining a pre-agreed rendevouz point on the LFnet IRC network.


Constructor Summary
IrcDiscovery(String channel)
          Finds a list of peers by connecting to an IRC network, joining a channel, decoding the nicks and then disconnecting.
IrcDiscovery(String channel, String server, int port)
          Finds a list of peers by connecting to an IRC network, joining a channel, decoding the nicks and then disconnecting.
 
Method Summary
 InetSocketAddress[] getPeers()
          Returns a list of peers that were found in the IRC channel.
protected  void onIRCReceive(String message)
           
protected  void onIRCSend(String message)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IrcDiscovery

public IrcDiscovery(String channel)
Finds a list of peers by connecting to an IRC network, joining a channel, decoding the nicks and then disconnecting.

Parameters:
channel - The IRC channel to join, either "#bitcoin" or "#bitcoinTEST" for the production and test networks respectively.

IrcDiscovery

public IrcDiscovery(String channel,
                    String server,
                    int port)
Finds a list of peers by connecting to an IRC network, joining a channel, decoding the nicks and then disconnecting.

Parameters:
server - Name or textual IP address of the IRC server to join.
channel - The IRC channel to join, either "#bitcoin" or "#bitcoinTEST" for the production and test networks
Method Detail

onIRCSend

protected void onIRCSend(String message)

onIRCReceive

protected void onIRCReceive(String message)

getPeers

public InetSocketAddress[] getPeers()
                             throws PeerDiscoveryException
Returns a list of peers that were found in the IRC channel. Note that just because a peer appears in the list does not mean it is accepting connections.

Specified by:
getPeers in interface PeerDiscovery
Throws:
PeerDiscoveryException


Copyright © 2011. All Rights Reserved.