com.limegroup.gnutella
Class RouterService

java.lang.Object
  extended bycom.limegroup.gnutella.RouterService

public class RouterService
extends java.lang.Object

A facade for the entire LimeWire backend. This is the GUI's primary way of communicating with the backend. RouterService constructs the backend components. Typical use is as follows:

 RouterService rs = new RouterService(ActivityCallback);
 rs.start();
 rs.query(...);
 rs.download(...);
 rs.shutdown();
 
The methods of this class are numerous, but they tend to fall into one of the following categories:


Constructor Summary
RouterService(ActivityCallback callback)
          Creates a new RouterService instance.
RouterService(ActivityCallback callback, MessageRouter router)
          Creates a new RouterService instance with special message handling code.
RouterService(ActivityCallback ac, MessageRouter mr, FileManager fm)
           
 
Method Summary
static boolean acceptedIncomingConnection()
          Returns true if this has accepted an incoming connection, and hence probably isn't firewalled.
static boolean addressChanged()
          Notifies components that this' IP address has changed.
static void adjustSpamFilters()
          Notifies the backend that spam filters settings have changed, and that extra work must be done.
static void clearHostCatcher()
          Clears the hostcatcher.
static void connect()
          Connects to the network.
static void connectToHostAsynchronously(java.lang.String hostname, int portnum)
          Creates a new outgoing messaging connection to the given host and port.
static ManagedConnection connectToHostBlocking(java.lang.String hostname, int portnum)
          Creates a new outgoing messaging connection to the given host and port.
static int countConnectionsWithNMessages(int messageThreshold)
          Count how many connections have already received N messages
static Chatter createChat(java.lang.String host, int port)
          Creates and returns a new chat to the given host and port.
static void disconnect()
          Disconnects from the network.
static void doBrowseHost(java.lang.String host, int port, GUID guid, GUID serventID, java.util.Set proxies)
          Browses the passed host
static Downloader download(java.io.File incompleteFile)
          Starts a resume download for the given incomplete file.
static Downloader download(RemoteFileDesc[] files, boolean overwrite)
          Stub for calling download(RemoteFileDesc[], DataUtils.EMPTY_LIST, boolean)
static Downloader download(RemoteFileDesc[] files, java.util.List alts, boolean overwrite)
          Tries to "smart download" any [sic] of the given files.
static Downloader download(java.lang.String query, java.lang.String richQuery, byte[] guid, MediaType type)
          Starts a "requery download", aka, a "wishlist download".
static Downloader download(URN urn, java.lang.String textQuery, java.lang.String filename, java.lang.String[] defaultURL)
           
static void dumpConnections()
          Prints out the information about current initialied connections
static void forceKeepAlive(int newKeep)
          Forces the backend to try to establish newKeep connections by kicking off connection fetchers as needed.
static Acceptor getAcceptor()
          Accessor for the Acceptor instance.
static int getActiveConnectionMessages()
          Count up all the messages on active connections
static byte[] getAddress()
          Returns the raw IP address for this host.
static ActivityCallback getCallback()
          Returns the ActivityCallback passed to this' constructor.
static ConnectionManager getConnectionManager()
          Accessor for the ConnectionManager instance.
static long getCurrentUptime()
          Returns the current uptime.
static DownloadManager getDownloadManager()
          Accessor for the DownloadManager instance in use.
static FileManager getFileManager()
          Accessor for the FileManager instance in use.
static HostCatcher getHostCatcher()
          Accessor for the HostCatcher instance.
static java.util.Iterator getHosts()
          Returns an iterator of the hosts in the host catcher, each an Endpoint.
static FileDesc[] getIncompleteFileDescriptors()
          Returns a list of all incomplete shared file descriptors.
static boolean getIsShuttingDown()
          Returns whether or not LimeWire is currently in the shutting down state, meaning that a shutdown has been initiated but not completed.
static long getLastQueryTime()
          Accessor for the last time a query was originated from this host.
static MessageRouter getMessageRouter()
          Accessor for the MessageRouter instance.
static byte[] getNonForcedAddress()
          Returns the Non-Forced IP address for this host.
static int getNonForcedPort()
          Returns the Non-Forced port for this host.
static int getNumActiveDownloads()
          Returns the number of active downloads.
static int getNumConnections()
          Returns the number of messaging connections.
static int getNumDownloads()
          Returns the number of downloads in progress.
static long getNumFiles()
          Returns the number of files in my horizon.
static int getNumFreeLeafSlots()
           
static int getNumFreeNonLeafSlots()
           
static long getNumHosts()
          Returns the number of good hosts in my horizon.
static int getNumIndividualDownloaders()
          Returns the number of individual downloaders.
static int getNumInitializedConnections()
          Returns the number of initialized messaging connections.
static int getNumLeafToUltrapeerConnections()
          Returns the number of leaf -> ultrapeer connections.
static int getNumOldConnections()
          Returns the number of old unrouted connections.
static int getNumPendingShared()
          Returns the number of files which are awaiting sharing.
static int getNumQueuedUploads()
          Returns the number of queued uploads.
static int getNumSharedFiles()
          Returns the number of files being shared locally.
static int getNumUltrapeerToLeafConnections()
          Returns the number of active ultrapeer -> leaf connections.
static int getNumUltrapeerToUltrapeerConnections()
          Returns the number of ultrapeer -> ultrapeer connections.
static int getNumUploads()
          Returns the number of uploads in progress.
static int getNumWaitingDownloads()
          Returns the number of downloads waiting to be started.
static int getPort()
          Returns the port used for downloads and messaging connections.
static PushManager getPushManager()
          Accessor for the PushManager instance.
static int getRealNumHosts()
          Returns the number of pongs in the host catcher.
static SearchResultHandler getSearchResultHandler()
          Accessor for the SearchResultHandler instance.
static FileDesc[] getSharedFileDescriptors(java.io.File directory)
          Returns a list of all shared file descriptors in the given directory.
static int getSharedFileSize()
          Returns the size in bytes of shared files.
static long getTotalFileSize()
          Returns the size of all files in my horizon, in kilobytes.
static GUID getUDPConnectBackGUID()
           
static UDPService getUdpService()
          Accessor for the UDPService instance.
static UploadManager getUploadManager()
          Accessor for the UploadManager instance.
static boolean isConnected()
          Returns whether or not this client currently has any initialized connections.
static boolean isGUESSCapable()
          Returns whether or not this node is capable of sending its own GUESS queries.
static boolean isMandragoreWorm(byte[] guid, Response response)
          Returns true if the given response for the query with the given guid is a result of the Madragore worm (8KB files of form "x.exe").
static boolean isShieldedLeaf()
          Accessor for whether or not this node is a shielded leaf.
static boolean isStarted()
          Used to determine whether or not the backend threads have been started.
static boolean isSupernode()
          Tells whether the node is a supernode or not
static boolean matchesType(byte[] guid, Response response)
          Returns true if the given response is of the same type as the the query with the given guid.
static byte[] newQueryGUID()
          Returns a new GUID for passing to query.
static void query(byte[] guid, java.lang.String query)
          Searches the network for files with the given query string and minimum speed, i.e., same as query(guid, query, minSpeed, null).
static void query(byte[] guid, java.lang.String query, MediaType type)
          Searches the network for files of the given type with the given GUID, query string and minimum speed.
static void query(byte[] guid, java.lang.String query, java.lang.String richQuery, MediaType type)
          Searches the network for files with the given metadata.
static void removeConnection(ManagedConnection c)
          Closes and removes the given connection.
static void removeHost(java.lang.String host, int port)
          Ensures that the given host:port pair is not in the host catcher.
static void schedule(java.lang.Runnable task, long delay, long period)
          Schedules the given task for repeated fixed-delay execution on this' backend thread.
static void setAlwaysNotifyKnownHost(boolean notify)
          Sets the host catcher's flag for always notifing ActivityCallback on a known host added to the catcher.
static void setIsShuttingDown(boolean flag)
          Sets the flag for whether or not LimeWire is currently in the process of shutting down.
static void setKeepAlive(int newKeep)
          Validates the passed new keep alive, and sets the backend to try to establish newKeep connections by kicking off connection fetchers as needed.
static void setListeningPort(int port)
          Sets the port on which to listen for incoming connections.
static void shutdown()
          Shuts down the backend and writes the gnutella.net file.
 void start()
          Starts various threads and tasks once all core classes have been constructed.
static void stopQuery(GUID guid)
          Will make all attempts to stop a query from executing.
static void updateHorizon()
          Updates the horizon statistics.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RouterService

public RouterService(ActivityCallback callback)
Creates a new RouterService instance. This fully constructs the backend.

Parameters:
callback - the ActivityCallback instance to use for making callbacks

RouterService

public RouterService(ActivityCallback ac,
                     MessageRouter mr,
                     FileManager fm)

RouterService

public RouterService(ActivityCallback callback,
                     MessageRouter router)
Creates a new RouterService instance with special message handling code. Typically this constructor is only used for testing.

Parameters:
callback - the ActivityCallback instance to use for making callbacks
router - the MessageRouter instance to use for handling all messages
Method Detail

start

public void start()
Starts various threads and tasks once all core classes have been constructed.


isStarted

public static boolean isStarted()
Used to determine whether or not the backend threads have been started.

Returns:
true if the backend threads have been started, otherwise false

getCallback

public static ActivityCallback getCallback()
Returns the ActivityCallback passed to this' constructor.

Returns:
the ActivityCallback passed to this' constructor -- this is one of the few accessors that can be null -- this will be null in the case where the RouterService has not been constructed

getMessageRouter

public static MessageRouter getMessageRouter()
Accessor for the MessageRouter instance.

Returns:
the MessageRouter instance in use -- this is one of the few accessors that can be null -- this will be null in the case where the RouterService has not been constructed

getFileManager

public static FileManager getFileManager()
Accessor for the FileManager instance in use.

Returns:
the FileManager in use

getDownloadManager

public static DownloadManager getDownloadManager()
Accessor for the DownloadManager instance in use.

Returns:
the DownloadManager in use

getUdpService

public static UDPService getUdpService()
Accessor for the UDPService instance.

Returns:
the UDPService instance in use

getConnectionManager

public static ConnectionManager getConnectionManager()
Accessor for the ConnectionManager instance.

Returns:
the ConnectionManager instance in use

getUploadManager

public static UploadManager getUploadManager()
Accessor for the UploadManager instance.

Returns:
the UploadManager in use

getPushManager

public static PushManager getPushManager()
Accessor for the PushManager instance.

Returns:
the PushManager in use

getAcceptor

public static Acceptor getAcceptor()
Accessor for the Acceptor instance.

Returns:
the Acceptor in use

getHostCatcher

public static HostCatcher getHostCatcher()
Accessor for the HostCatcher instance.

Returns:
the HostCatcher in use

getSearchResultHandler

public static SearchResultHandler getSearchResultHandler()
Accessor for the SearchResultHandler instance.

Returns:
the SearchResultHandler in use

schedule

public static void schedule(java.lang.Runnable task,
                            long delay,
                            long period)
Schedules the given task for repeated fixed-delay execution on this' backend thread. The task must not block for too long, as a single thread is shared among all the backend.

Parameters:
task - the task to run repeatedly
delay - the initial delay, in milliseconds
period - the delay between executions, in milliseconds
Throws:
java.lang.IllegalStateException - this is cancelled
java.lang.IllegalArgumentException - delay or period negative
See Also:
SimpleTimer.schedule(java.lang.Runnable,long,long)

connectToHostBlocking

public static ManagedConnection connectToHostBlocking(java.lang.String hostname,
                                                      int portnum)
                                               throws java.io.IOException
Creates a new outgoing messaging connection to the given host and port. Blocks until the connection established. Throws IOException if the connection failed.

Returns:
a connection to the request host
Throws:
java.io.IOException - the connection failed

connectToHostAsynchronously

public static void connectToHostAsynchronously(java.lang.String hostname,
                                               int portnum)
Creates a new outgoing messaging connection to the given host and port. Returns immediately without blocking. If hostname would connect us to ourselves, returns immediately.


connect

public static void connect()
Connects to the network. Ensures the number of messaging connections (keep-alive) is non-zero and recontacts the pong server as needed.


disconnect

public static void disconnect()
Disconnects from the network. Closes all connections and sets the number of connections to zero.


removeConnection

public static void removeConnection(ManagedConnection c)
Closes and removes the given connection.


clearHostCatcher

public static void clearHostCatcher()
Clears the hostcatcher.


getRealNumHosts

public static int getRealNumHosts()
Returns the number of pongs in the host catcher. This method is poorly named, but it's obsolescent, so I won't bother to rename it.


getNumDownloads

public static int getNumDownloads()
Returns the number of downloads in progress.


getNumActiveDownloads

public static int getNumActiveDownloads()
Returns the number of active downloads.


getNumWaitingDownloads

public static int getNumWaitingDownloads()
Returns the number of downloads waiting to be started.


getNumIndividualDownloaders

public static int getNumIndividualDownloaders()
Returns the number of individual downloaders.


getNumUploads

public static int getNumUploads()
Returns the number of uploads in progress.


getNumQueuedUploads

public static int getNumQueuedUploads()
Returns the number of queued uploads.


getCurrentUptime

public static long getCurrentUptime()
Returns the current uptime.


shutdown

public static void shutdown()
Shuts down the backend and writes the gnutella.net file.


forceKeepAlive

public static void forceKeepAlive(int newKeep)
Forces the backend to try to establish newKeep connections by kicking off connection fetchers as needed. Does not affect the NUM_CONNECTIONS property.

Parameters:
newKeep - the desired total number of messaging connections

setKeepAlive

public static void setKeepAlive(int newKeep)
                         throws BadConnectionSettingException
Validates the passed new keep alive, and sets the backend to try to establish newKeep connections by kicking off connection fetchers as needed. Does not affect the NUM_CONNECTIONS property.

Parameters:
newKeep - the desired total number of messaging connections
Throws:
if - the suggested keep alive value is not suitable
BadConnectionSettingException

adjustSpamFilters

public static void adjustSpamFilters()
Notifies the backend that spam filters settings have changed, and that extra work must be done.


setListeningPort

public static void setListeningPort(int port)
                             throws java.io.IOException
Sets the port on which to listen for incoming connections. If that fails, this is not modified and IOException is thrown. If port==0, tells this to stop listening to incoming connections.

Throws:
java.io.IOException

setAlwaysNotifyKnownHost

public static void setAlwaysNotifyKnownHost(boolean notify)
Sets the host catcher's flag for always notifing ActivityCallback on a known host added to the catcher.


acceptedIncomingConnection

public static boolean acceptedIncomingConnection()
Returns true if this has accepted an incoming connection, and hence probably isn't firewalled. (This is useful for colorizing search results in the GUI.)


getActiveConnectionMessages

public static int getActiveConnectionMessages()
Count up all the messages on active connections


countConnectionsWithNMessages

public static int countConnectionsWithNMessages(int messageThreshold)
Count how many connections have already received N messages


getNumHosts

public static long getNumHosts()
Returns the number of good hosts in my horizon.


getNumFiles

public static long getNumFiles()
Returns the number of files in my horizon.


getTotalFileSize

public static long getTotalFileSize()
Returns the size of all files in my horizon, in kilobytes.


dumpConnections

public static void dumpConnections()
Prints out the information about current initialied connections


updateHorizon

public static void updateHorizon()
Updates the horizon statistics. This should called at least every five minutes or so to prevent the reported numbers from growing too large. You can safely call it more often. Note that it does not modify the network; horizon stats are calculated by passively looking at messages.


newQueryGUID

public static byte[] newQueryGUID()
Returns a new GUID for passing to query.


query

public static void query(byte[] guid,
                         java.lang.String query,
                         MediaType type)
Searches the network for files of the given type with the given GUID, query string and minimum speed. If type is null, any file type is acceptable.

ActivityCallback is notified asynchronously of responses. These responses can be matched with requests by looking at their GUIDs. (You may want to wrap the bytes with a GUID object for simplicity.) An earlier version of this method returned the reply GUID instead of taking it as an argument. Unfortunately this caused a race condition where replies were returned before the GUI was prepared to handle them.

Parameters:
guid - the guid to use for the query. MUST be a 16-byte value as returned by newQueryGUID.
query - the query string to use
type - the desired type of result (e.g., audio, video), or null if you don't care

query

public static void query(byte[] guid,
                         java.lang.String query)
Searches the network for files with the given query string and minimum speed, i.e., same as query(guid, query, minSpeed, null).

See Also:
query(byte[], String, MediaType)

query

public static void query(byte[] guid,
                         java.lang.String query,
                         java.lang.String richQuery,
                         MediaType type)
Searches the network for files with the given metadata.

Parameters:
richQuery - metadata query to insert between the nulls, typically in XML format
See Also:
query(byte[], String, MediaType)

getLastQueryTime

public static long getLastQueryTime()
Accessor for the last time a query was originated from this host.

Returns:
a long representing the number of milliseconds since January 1, 1970, that the last query originated from this host

stopQuery

public static void stopQuery(GUID guid)
Will make all attempts to stop a query from executing. Really only applicable to GUESS queries...

Parameters:
guid - The GUID of the query you want to get rid of....

matchesType

public static boolean matchesType(byte[] guid,
                                  Response response)
Returns true if the given response is of the same type as the the query with the given guid. Returns 100 if guid is not recognized.

Parameters:
guid - the value returned by query(..). MUST be 16 bytes long.
See Also:
ResponseVerifier.matchesType(byte[], Response)

isMandragoreWorm

public static boolean isMandragoreWorm(byte[] guid,
                                       Response response)
Returns true if the given response for the query with the given guid is a result of the Madragore worm (8KB files of form "x.exe"). Returns false if guid is not recognized. Ideally this would be done by the normal filtering mechanism, but it is not powerful enough without the query string.

Parameters:
guid - the value returned by query(..). MUST be 16 byts long.
See Also:
ResponseVerifier.isMandragoreWorm(byte[], Response)

getHosts

public static java.util.Iterator getHosts()
Returns an iterator of the hosts in the host catcher, each an Endpoint.


getNumConnections

public static int getNumConnections()
Returns the number of messaging connections.


getNumInitializedConnections

public static int getNumInitializedConnections()
Returns the number of initialized messaging connections.


getNumUltrapeerToLeafConnections

public static int getNumUltrapeerToLeafConnections()
Returns the number of active ultrapeer -> leaf connections.


getNumLeafToUltrapeerConnections

public static int getNumLeafToUltrapeerConnections()
Returns the number of leaf -> ultrapeer connections.


getNumUltrapeerToUltrapeerConnections

public static int getNumUltrapeerToUltrapeerConnections()
Returns the number of ultrapeer -> ultrapeer connections.


getNumOldConnections

public static int getNumOldConnections()
Returns the number of old unrouted connections.


isConnected

public static boolean isConnected()
Returns whether or not this client currently has any initialized connections.

Returns:
true if the client does have initialized connections, false otherwise

removeHost

public static void removeHost(java.lang.String host,
                              int port)
Ensures that the given host:port pair is not in the host catcher.


getNumSharedFiles

public static int getNumSharedFiles()
Returns the number of files being shared locally.


getNumPendingShared

public static int getNumPendingShared()
Returns the number of files which are awaiting sharing.


getSharedFileSize

public static int getSharedFileSize()
Returns the size in bytes of shared files.

Returns:
the size in bytes of shared files on this host

getIncompleteFileDescriptors

public static FileDesc[] getIncompleteFileDescriptors()
Returns a list of all incomplete shared file descriptors.


getSharedFileDescriptors

public static FileDesc[] getSharedFileDescriptors(java.io.File directory)
Returns a list of all shared file descriptors in the given directory. All the file descriptors returned have already been passed to the gui via ActivityCallback.addSharedFile. Note that if a file descriptor is added to the given directory after this method completes, addSharedFile will be called for that file descriptor.

If directory is not a shared directory, returns null.


download

public static Downloader download(RemoteFileDesc[] files,
                                  java.util.List alts,
                                  boolean overwrite)
                           throws FileExistsException,
                                  AlreadyDownloadingException,
                                  java.io.FileNotFoundException
Tries to "smart download" any [sic] of the given files.

If any of the files already being downloaded (or queued for downloaded) has the same temporary name as any of the files in 'files', throws AlreadyDownloadingException. Note, however, that this doesn't guarantee that a successfully downloaded file can be moved to the library.

If overwrite==false, then if any of the files already exists in the download directory, FileExistsException is thrown and no files are modified. If overwrite==true, the files may be overwritten.

Otherwise returns a Downloader that allows you to stop and resume this download. The ActivityCallback will also be notified of this download, so the return value can usually be ignored. The download begins immediately, unless it is queued. It stops after any of the files succeeds.

Parameters:
files - a group of "similar" files to smart download
alts - a List of secondary RFDs to use for other sources
overwrite - true iff the download should proceded without checking if it's on disk
Returns:
the download object you can use to start and resume the download
Throws:
AlreadyDownloadingException - the file is already being downloaded.
FileExistsException - the file already exists in the library
java.io.FileNotFoundException
See Also:
DownloadManager#getFiles(RemoteFileDesc[], boolean)

download

public static Downloader download(RemoteFileDesc[] files,
                                  boolean overwrite)
                           throws FileExistsException,
                                  AlreadyDownloadingException,
                                  java.io.FileNotFoundException
Stub for calling download(RemoteFileDesc[], DataUtils.EMPTY_LIST, boolean)

Throws:
FileExistsException
AlreadyDownloadingException
java.io.FileNotFoundException

download

public static Downloader download(URN urn,
                                  java.lang.String textQuery,
                                  java.lang.String filename,
                                  java.lang.String[] defaultURL)
                           throws java.lang.IllegalArgumentException,
                                  AlreadyDownloadingException
Throws:
java.lang.IllegalArgumentException
AlreadyDownloadingException

download

public static Downloader download(java.io.File incompleteFile)
                           throws AlreadyDownloadingException,
                                  CantResumeException
Starts a resume download for the given incomplete file.

Throws:
AlreadyDownloadingException - couldn't download because the another downloader is getting the file
CantResumeException - incompleteFile is not a valid incomplete file

download

public static Downloader download(java.lang.String query,
                                  java.lang.String richQuery,
                                  byte[] guid,
                                  MediaType type)
                           throws AlreadyDownloadingException
Starts a "requery download", aka, a "wishlist download". A "requery download" should be started when the user has not received any results for her query, and wants LimeWire to spawn a specialized Downloader that requeries the network until a 'appropriate' file is found.

Parameters:
query - The original query string.
richQuery - The original richQuery string.
guid - The guid associated with this query request.
type - The mediatype associated with this search.
Throws:
AlreadyDownloadingException

createChat

public static Chatter createChat(java.lang.String host,
                                 int port)
Creates and returns a new chat to the given host and port.


doBrowseHost

public static void doBrowseHost(java.lang.String host,
                                int port,
                                GUID guid,
                                GUID serventID,
                                java.util.Set proxies)
Browses the passed host

Parameters:
host - The host to browse
port - The port at which to browse
guid - The guid to be used for the query replies received while browsing host
serventID - The guid of the client to browse from. I need this in case I need to push....
proxies - the list of PushProxies we can use - may be null.

isSupernode

public static boolean isSupernode()
Tells whether the node is a supernode or not

Returns:
true, if supernode, false otherwise

isShieldedLeaf

public static boolean isShieldedLeaf()
Accessor for whether or not this node is a shielded leaf.

Returns:
true if this node is a shielded leaf, false otherwise

getNumFreeLeafSlots

public static int getNumFreeLeafSlots()
Returns:
the number of free leaf slots.

getNumFreeNonLeafSlots

public static int getNumFreeNonLeafSlots()
Returns:
the number of free non-leaf slots.

setIsShuttingDown

public static void setIsShuttingDown(boolean flag)
Sets the flag for whether or not LimeWire is currently in the process of shutting down.

Parameters:
flag - the shutting down state to set

getIsShuttingDown

public static boolean getIsShuttingDown()
Returns whether or not LimeWire is currently in the shutting down state, meaning that a shutdown has been initiated but not completed. This is most often the case when there are active file transfers and the application is set to shutdown after current file transfers are complete.

Returns:
true if the application is in the shutting down state, false otherwise

addressChanged

public static boolean addressChanged()
Notifies components that this' IP address has changed.


getAddress

public static byte[] getAddress()
Returns the raw IP address for this host.

Returns:
the raw IP address for this host

getNonForcedAddress

public static byte[] getNonForcedAddress()
Returns the Non-Forced IP address for this host.

Returns:
the non-forced IP address for this host

getPort

public static int getPort()
Returns the port used for downloads and messaging connections. Used to fill out the My-Address header in ManagedConnection.

See Also:
Acceptor.getPort(boolean)

getNonForcedPort

public static int getNonForcedPort()
Returns the Non-Forced port for this host.

Returns:
the non-forced port for this host

isGUESSCapable

public static boolean isGUESSCapable()
Returns whether or not this node is capable of sending its own GUESS queries. This would not be the case only if this node has not successfully received an incoming UDP packet.

Returns:
true if this node is capable of running its own GUESS queries, false otherwise

getUDPConnectBackGUID

public static GUID getUDPConnectBackGUID()