|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.eyebolt.iplib.IPManager
Main entry point for the iplib library.
Inner Class Summary | |
(package private) class |
IPManager.ShutdownRunner
|
Field Summary | |
static int |
BASE
Constructor arg to select BASE tcp/ip messaging. |
private java.util.Vector |
connections
array of connections that have been made |
private int |
datatype
|
static int |
ERR_PORT_IN_USE
Error returned by listen when the port is not available |
static int |
HTTP_TUNNEL
Constructor arg to select HTTP tcp/ip messaging. |
private java.util.Vector |
listenThreads
array of threads, each listening on a port |
(package private) java.util.Vector |
msgReplies
mapping from message ID to reply |
private IPCallback |
onreceive
|
private IPAddress |
proxyAddress
Address of proxy server. |
static int |
RAW
Constructor arg to select RAW TCP/IP |
static int |
SUCCESS
Value returned when an operation runs successfully |
static int |
TEXT
Constructor arg to select Line (cr/lf) oriented TCP/IP |
private RecvThreadMgr |
threadManager
handler for pool of receive threads |
private java.util.Vector |
timeoutReplies
mapping from timeout to reply (for replyvulture) |
private VultureThread |
vulture
|
Constructor Summary | |
IPManager(int reqtype)
No argument constructor |
Method Summary | |
(package private) void |
addKey(IPKey key)
Adds a feature to the Key attribute of the IPManager object |
(package private) void |
addReply(IPReply rep)
Adds a reply to the IPManager object |
IPKey |
connect(IPAddress address)
Connect to a given address; check the status of the ConnKey to determine if the connection was successful. |
void |
disconnect(IPKey key)
Disconnect the connection represented by this connection key. |
void |
endListen(IPAddress address)
Cease listening for new connections. |
(package private) int |
getDatatype()
Get datatype/data transfer mode for this IPManager |
(package private) IPCallback |
getOnReceive()
Get onrecieve callback |
(package private) IPReply |
getReply(int msgID)
Fetch a reply to a given message |
int |
listen(IPAddress address,
IPCallback callback)
Begin listening for new TCP/IP connections on the given address. |
int |
onReceive(IPCallback cb)
Specify a default callback function for messages received. |
void |
setHttpProxy(IPAddress proxyAddress)
Specify the address of an HTTP proxy server, for HTTP_TUNNEL mode. |
void |
shutdown()
Shutdown IPManager; disconnect all connections, clean up. |
private void |
trace(java.lang.String s)
Write a trace message to standard output stream. |
Methods inherited from class java.lang.Object |
|
Field Detail |
public static final int RAW
public static final int TEXT
public static final int BASE
public static final int HTTP_TUNNEL
public static final int SUCCESS
public static final int ERR_PORT_IN_USE
private IPAddress proxyAddress
private java.util.Vector connections
private java.util.Vector timeoutReplies
java.util.Vector msgReplies
private RecvThreadMgr threadManager
private VultureThread vulture
private int datatype
private IPCallback onreceive
private java.util.Vector listenThreads
Constructor Detail |
public IPManager(int reqtype)
reqtype
- Specifies the kind of connections this manager will be
making; can be BASE, TEXT, or RAW.
If type is BASE, messages will have fixed
length headers prepended that will specify the size of message, and the
other end will repackage the message back, if it was broken up in transit.
If the type is text, messages will be expected to be terminated with
carriage returns.
Raw will just return each chunk of data that is received.Method Detail |
public void setHttpProxy(IPAddress proxyAddress)
cb
- Description of Parameterpublic int onReceive(IPCallback cb)
cb
- Description of Parameterpublic IPKey connect(IPAddress address) throws java.io.IOException
address
- address to which the manager should connectjava.io.IOException
- on network errorpublic void disconnect(IPKey key)
key
- key representing the connection to disconnect.public int listen(IPAddress address, IPCallback callback)
address
- The ip and port on which to listen for connections.callback
- a callback to receive notification upon receiving a
connnection.public void endListen(IPAddress address)
address
- address on which the listen was started.public void shutdown()
key
- key representing the connection to disconnect.IPReply getReply(int msgID)
msgID
- Id of the message we want a reply forIPCallback getOnReceive()
int getDatatype()
void addReply(IPReply rep)
rep
- The feature to be added to the Reply attributevoid addKey(IPKey key) throws java.io.IOException
key
- The feature to be added to the Key attributejava.io.IOException
- Description of Exceptionprivate final void trace(java.lang.String s)
s
- string to write
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |