|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Object ConnectionHandler DirectConnectionHandler
Connection handler for direct connections to Yahoo. Pass this
class into the Session
constructor to create a session
which has no firewall or proxy requirements.
There are two system properties which alter the target of a connection.
ymsg.network.directHost
can be used to set the host to
which the connection will be made. ymsg.network.directPorts
can be used to set a comma-separated-list of ports to be tried in
order (the first number on this list is treated as the primary port).
In reality is it highly unlikely that these properties should need
to be changed from their defaults: scs.msg.yahoo.com
and
5050,23,25,80
.
Constructor Summary | |
DirectConnectionHandler()
Connect to the default host and port, or try all the fallback ports if the default port does not respond. |
|
DirectConnectionHandler(boolean fl)
Connect to the default host and port, but will not resort to fallback ports if the parameter is true. |
|
DirectConnectionHandler(int p)
Connect to the default host with the specified port, and will not resort the fallback. |
|
DirectConnectionHandler(String h,
int p)
Connect to a specific host and port. |
Method Summary | |
String |
getHost()
Returns the actual host name used for this connection. |
int |
getPort()
Returns the actual port number used for this connection. |
String |
toString()
Returns the string representation of this object. |
Methods inherited from class Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public DirectConnectionHandler(String h, int p)
h
- hostp
- port numberpublic DirectConnectionHandler(int p)
For example, having initially used the default constructor (or the
boolean constructor, set to true) to employ fallback ports until a
clear path is found, the application then may use getPort
to discover which port was actually successful, storing this
information in a configuration file. When restarted, the application
can then attempt to direct traffic straight to this port, avoiding
the lenghty trial-and-error process.
p
- port numberpublic DirectConnectionHandler(boolean fl)
fl
- false tries only the default portpublic DirectConnectionHandler()
Method Detail |
public String getHost()
public int getPort()
public String toString()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |