Class NNTPClient
You should keep in mind that the NNTP server may choose to prematurely
close a connection if the client has been idle for longer than a
given time period or if the server is being shutdown by the operator or
some other reason. The NNTP class will detect a
premature NNTP server connection closing when it receives a
NNTPReply.SERVICE_DISCONTINUED response to a command.
When that occurs, the NNTP class method encountering that reply will throw
an
NNTPConnectionClosedException .
NNTPConectionClosedException
is a subclass of IOException
and therefore need not be
caught separately, but if you are going to catch it separately, its
catch block must appear before the more general IOException
catch block. When you encounter an
NNTPConnectionClosedException , you must disconnect the connection with
disconnect()
to properly clean up the
system resources used by NNTP. Before disconnecting, you may check the
last reply code and text with
getReplyCode and
getReplyString .
Rather than list it separately for each method, we mention here that every method communicating with the server and throwing an IOException can also throw a MalformedServerReplyException , which is a subclass of IOException. A MalformedServerReplyException will be thrown when the reply received from the server deviates enough from the protocol specification that it cannot be interpreted in a useful manner despite attempts to be as lenient as possible.
- Author:
- Daniel F. Savarese
- See Also:
-
Field Summary
Fields inherited from class com.oroinc.net.nntp.NNTP
_commandSupport_, DEFAULT_PORT
Fields inherited from class com.oroinc.net.SocketClient
_defaultPort_, _input_, _isConnected_, _output_, _socket_, _socketFactory_, _timeout_, NETASCII_EOL
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
There are a few NNTPClient methods that do not complete the entire sequence of NNTP commands to complete a transaction.forwardArticle
(String articleId) listHelp()
List the command help from the server.String[]
listNewNews
(NewGroupsOrNewsQuery query) List all new articles added to the NNTP server since a particular date subject to the conditions of the specified query.List all new newsgroups added to the NNTP server since a particular date subject to the conditions of the specified query.List all newsgroups served by the NNTP server.boolean
logout()
Logs out of the news server gracefully by sending the QUIT command.Post an article to the NNTP server.Same asretrieveArticle(null)
retrieveArticle
(int articleNumber) Same asretrieveArticle(articleNumber, null)
retrieveArticle
(int articleNumber, ArticlePointer pointer) Retrieves an article from the currently selected newsgroup.retrieveArticle
(String articleId) Same asretrieveArticle(articleId, null)
retrieveArticle
(String articleId, ArticlePointer pointer) Retrieves an article from the NNTP server.Same asretrieveArticleBody(null)
retrieveArticleBody
(int articleNumber) Same asretrieveArticleBody(articleNumber, null)
retrieveArticleBody
(int articleNumber, ArticlePointer pointer) Retrieves an article body from the currently selected newsgroup.retrieveArticleBody
(String articleId) Same asretrieveArticleBody(articleId, null)
retrieveArticleBody
(String articleId, ArticlePointer pointer) Retrieves an article body from the NNTP server.Same asretrieveArticleHeader(null)
retrieveArticleHeader
(int articleNumber) Same asretrieveArticleHeader(articleNumber, null)
retrieveArticleHeader
(int articleNumber, ArticlePointer pointer) Retrieves an article header from the currently selected newsgroup.retrieveArticleHeader
(String articleId) Same asretrieveArticleHeader(articleId, null)
retrieveArticleHeader
(String articleId, ArticlePointer pointer) Retrieves an article header from the NNTP server.boolean
selectArticle
(int articleNumber) Same asselectArticle(articleNumber, null)
boolean
selectArticle
(int articleNumber, ArticlePointer pointer) Select an article in the currently selected newsgroup by its number.boolean
selectArticle
(ArticlePointer pointer) Same asselectArticle(null, articleId)
.boolean
selectArticle
(String articleId) Same asselectArticle(articleId, null)
boolean
selectArticle
(String articleId, ArticlePointer pointer) Select an article by its unique identifier (including enclosing invalid input: '<' and invalid input: '>') and return its article number and id through the pointer parameter.boolean
selectNewsgroup
(String newsgroup) Same asselectNewsgroup(newsgroup, null)
boolean
selectNewsgroup
(String newsgroup, NewsgroupInfo info) Select the specified newsgroup to be the target of for future article retrieval and posting operations.boolean
Same asselectNextArticle(null)
boolean
selectNextArticle
(ArticlePointer pointer) Select the article following the currently selected article in the currently selected newsgroup and return its number and unique id through the pointer parameter.boolean
Same asselectPreviousArticle(null)
boolean
selectPreviousArticle
(ArticlePointer pointer) Select the article preceeding the currently selected article in the currently selected newsgroup and return its number and unique id through the pointer parameter.Methods inherited from class com.oroinc.net.nntp.NNTP
_connectAction_, addProtocolCommandListener, article, article, article, body, body, body, disconnect, getReply, getReplyCode, getReplyString, group, head, head, head, help, ihave, isAllowedToPost, last, list, newgroups, newnews, next, post, quit, removeProtocolCommandistener, sendCommand, sendCommand, sendCommand, sendCommand, stat, stat, stat
Methods inherited from class com.oroinc.net.SocketClient
connect, connect, connect, connect, connect, connect, getDefaultPort, getDefaultTimeout, getLocalAddress, getLocalPort, getRemoteAddress, getRemotePort, getSoLinger, getSoTimeout, getTcpNoDelay, isConnected, setDefaultPort, setDefaultTimeout, setSocketFactory, setSoLinger, setSoTimeout, setTcpNoDelay, verifyRemote
-
Constructor Details
-
NNTPClient
public NNTPClient()
-
-
Method Details
-
retrieveArticle
Retrieves an article from the NNTP server. The article is referenced by its unique article identifier (including the enclosing invalid input: '<' and invalid input: '>'). The article number and identifier contained in the server reply are returned through an ArticlePointer. ThearticleId
field of the ArticlePointer cannot always be trusted because some NNTP servers do not correctly follow the RFC 977 reply format.A DotTerminatedMessageReader is returned from which the article can be read. If the article does not exist, null is returned.
You must not issue any commands to the NNTP server (i.e., call any other methods) until you finish reading the message from the returned Reader instance. The NNTP protocol uses the same stream for issuing commands as it does for returning results. Therefore the returned Reader actually reads directly from the NNTP connection. After the end of message has been reached, new commands can be executed and their replies read. If you do not follow these requirements, your program will not work properly.
- Parameters:
articleId
- The unique article identifier of the article to retrieve. If this parameter is null, the currently selected article is retrieved.pointer
- A parameter through which to return the article's number and unique id. The articleId field cannot always be trusted because of server deviations from RFC 977 reply formats. You may set this parameter to null if you do not desire to retrieve the returned article information.- Returns:
- A DotTerminatedMessageReader instance from which the article be read. null if the article does not exist.
- Throws:
NNTPConnectionClosedException
- If the NNTP server prematurely closes the connection as a result of the client being idle or some other reason causing the server to send NNTP reply code 400. This exception may be caught either as an IOException or independently as itself.IOException
- If an I/O error occurs while either sending a command to the server or receiving a reply from the server.
-
retrieveArticle
Same asretrieveArticle(articleId, null)
- Throws:
IOException
-
retrieveArticle
Same asretrieveArticle(null)
- Throws:
IOException
-
retrieveArticle
Retrieves an article from the currently selected newsgroup. The article is referenced by its article number. The article number and identifier contained in the server reply are returned through an ArticlePointer. ThearticleId
field of the ArticlePointer cannot always be trusted because some NNTP servers do not correctly follow the RFC 977 reply format.A DotTerminatedMessageReader is returned from which the article can be read. If the article does not exist, null is returned.
You must not issue any commands to the NNTP server (i.e., call any other methods) until you finish reading the message from the returned Reader instance. The NNTP protocol uses the same stream for issuing commands as it does for returning results. Therefore the returned Reader actually reads directly from the NNTP connection. After the end of message has been reached, new commands can be executed and their replies read. If you do not follow these requirements, your program will not work properly.
- Parameters:
articleNumber
- The number of the the article to retrieve.pointer
- A parameter through which to return the article's number and unique id. The articleId field cannot always be trusted because of server deviations from RFC 977 reply formats. You may set this parameter to null if you do not desire to retrieve the returned article information.- Returns:
- A DotTerminatedMessageReader instance from which the article be read. null if the article does not exist.
- Throws:
NNTPConnectionClosedException
- If the NNTP server prematurely closes the connection as a result of the client being idle or some other reason causing the server to send NNTP reply code 400. This exception may be caught either as an IOException or independently as itself.IOException
- If an I/O error occurs while either sending a command to the server or receiving a reply from the server.
-
retrieveArticle
Same asretrieveArticle(articleNumber, null)
- Throws:
IOException
-
retrieveArticleHeader
Retrieves an article header from the NNTP server. The article is referenced by its unique article identifier (including the enclosing invalid input: '<' and invalid input: '>'). The article number and identifier contained in the server reply are returned through an ArticlePointer. ThearticleId
field of the ArticlePointer cannot always be trusted because some NNTP servers do not correctly follow the RFC 977 reply format.A DotTerminatedMessageReader is returned from which the article can be read. If the article does not exist, null is returned.
You must not issue any commands to the NNTP server (i.e., call any other methods) until you finish reading the message from the returned Reader instance. The NNTP protocol uses the same stream for issuing commands as it does for returning results. Therefore the returned Reader actually reads directly from the NNTP connection. After the end of message has been reached, new commands can be executed and their replies read. If you do not follow these requirements, your program will not work properly.
- Parameters:
articleId
- The unique article identifier of the article whose header is being retrieved. If this parameter is null, the header of the currently selected article is retrieved.pointer
- A parameter through which to return the article's number and unique id. The articleId field cannot always be trusted because of server deviations from RFC 977 reply formats. You may set this parameter to null if you do not desire to retrieve the returned article information.- Returns:
- A DotTerminatedMessageReader instance from which the article header can be read. null if the article does not exist.
- Throws:
NNTPConnectionClosedException
- If the NNTP server prematurely closes the connection as a result of the client being idle or some other reason causing the server to send NNTP reply code 400. This exception may be caught either as an IOException or independently as itself.IOException
- If an I/O error occurs while either sending a command to the server or receiving a reply from the server.
-
retrieveArticleHeader
Same asretrieveArticleHeader(articleId, null)
- Throws:
IOException
-
retrieveArticleHeader
Same asretrieveArticleHeader(null)
- Throws:
IOException
-
retrieveArticleHeader
Retrieves an article header from the currently selected newsgroup. The article is referenced by its article number. The article number and identifier contained in the server reply are returned through an ArticlePointer. ThearticleId
field of the ArticlePointer cannot always be trusted because some NNTP servers do not correctly follow the RFC 977 reply format.A DotTerminatedMessageReader is returned from which the article can be read. If the article does not exist, null is returned.
You must not issue any commands to the NNTP server (i.e., call any other methods) until you finish reading the message from the returned Reader instance. The NNTP protocol uses the same stream for issuing commands as it does for returning results. Therefore the returned Reader actually reads directly from the NNTP connection. After the end of message has been reached, new commands can be executed and their replies read. If you do not follow these requirements, your program will not work properly.
- Parameters:
articleNumber
- The number of the the article whose header is being retrieved.pointer
- A parameter through which to return the article's number and unique id. The articleId field cannot always be trusted because of server deviations from RFC 977 reply formats. You may set this parameter to null if you do not desire to retrieve the returned article information.- Returns:
- A DotTerminatedMessageReader instance from which the article header can be read. null if the article does not exist.
- Throws:
NNTPConnectionClosedException
- If the NNTP server prematurely closes the connection as a result of the client being idle or some other reason causing the server to send NNTP reply code 400. This exception may be caught either as an IOException or independently as itself.IOException
- If an I/O error occurs while either sending a command to the server or receiving a reply from the server.
-
retrieveArticleHeader
Same asretrieveArticleHeader(articleNumber, null)
- Throws:
IOException
-
retrieveArticleBody
Retrieves an article body from the NNTP server. The article is referenced by its unique article identifier (including the enclosing invalid input: '<' and invalid input: '>'). The article number and identifier contained in the server reply are returned through an ArticlePointer. ThearticleId
field of the ArticlePointer cannot always be trusted because some NNTP servers do not correctly follow the RFC 977 reply format.A DotTerminatedMessageReader is returned from which the article can be read. If the article does not exist, null is returned.
You must not issue any commands to the NNTP server (i.e., call any other methods) until you finish reading the message from the returned Reader instance. The NNTP protocol uses the same stream for issuing commands as it does for returning results. Therefore the returned Reader actually reads directly from the NNTP connection. After the end of message has been reached, new commands can be executed and their replies read. If you do not follow these requirements, your program will not work properly.
- Parameters:
articleId
- The unique article identifier of the article whose body is being retrieved. If this parameter is null, the body of the currently selected article is retrieved.pointer
- A parameter through which to return the article's number and unique id. The articleId field cannot always be trusted because of server deviations from RFC 977 reply formats. You may set this parameter to null if you do not desire to retrieve the returned article information.- Returns:
- A DotTerminatedMessageReader instance from which the article body can be read. null if the article does not exist.
- Throws:
NNTPConnectionClosedException
- If the NNTP server prematurely closes the connection as a result of the client being idle or some other reason causing the server to send NNTP reply code 400. This exception may be caught either as an IOException or independently as itself.IOException
- If an I/O error occurs while either sending a command to the server or receiving a reply from the server.
-
retrieveArticleBody
Same asretrieveArticleBody(articleId, null)
- Throws:
IOException
-
retrieveArticleBody
Same asretrieveArticleBody(null)
- Throws:
IOException
-
retrieveArticleBody
Retrieves an article body from the currently selected newsgroup. The article is referenced by its article number. The article number and identifier contained in the server reply are returned through an ArticlePointer. ThearticleId
field of the ArticlePointer cannot always be trusted because some NNTP servers do not correctly follow the RFC 977 reply format.A DotTerminatedMessageReader is returned from which the article can be read. If the article does not exist, null is returned.
You must not issue any commands to the NNTP server (i.e., call any other methods) until you finish reading the message from the returned Reader instance. The NNTP protocol uses the same stream for issuing commands as it does for returning results. Therefore the returned Reader actually reads directly from the NNTP connection. After the end of message has been reached, new commands can be executed and their replies read. If you do not follow these requirements, your program will not work properly.
- Parameters:
articleNumber
- The number of the the article whose body is being retrieved.pointer
- A parameter through which to return the article's number and unique id. The articleId field cannot always be trusted because of server deviations from RFC 977 reply formats. You may set this parameter to null if you do not desire to retrieve the returned article information.- Returns:
- A DotTerminatedMessageReader instance from which the article body can be read. null if the article does not exist.
- Throws:
NNTPConnectionClosedException
- If the NNTP server prematurely closes the connection as a result of the client being idle or some other reason causing the server to send NNTP reply code 400. This exception may be caught either as an IOException or independently as itself.IOException
- If an I/O error occurs while either sending a command to the server or receiving a reply from the server.
-
retrieveArticleBody
Same asretrieveArticleBody(articleNumber, null)
- Throws:
IOException
-
selectNewsgroup
Select the specified newsgroup to be the target of for future article retrieval and posting operations. Also return the newsgroup information contained in the server reply through the info parameter.- Parameters:
newsgroup
- The newsgroup to select.info
- A parameter through which the newsgroup information of the selected newsgroup contained in the server reply is returned. Set this to null if you do not desire this information.- Returns:
- True if the newsgroup exists and was selected, false otherwise.
- Throws:
NNTPConnectionClosedException
- If the NNTP server prematurely closes the connection as a result of the client being idle or some other reason causing the server to send NNTP reply code 400. This exception may be caught either as an IOException or independently as itself.IOException
- If an I/O error occurs while either sending a command to the server or receiving a reply from the server.
-
selectNewsgroup
Same asselectNewsgroup(newsgroup, null)
- Throws:
IOException
-
listHelp
List the command help from the server.- Returns:
- The sever help information.
- Throws:
NNTPConnectionClosedException
- If the NNTP server prematurely closes the connection as a result of the client being idle or some other reason causing the server to send NNTP reply code 400. This exception may be caught either as an IOException or independently as itself.IOException
- If an I/O error occurs while either sending a command to the server or receiving a reply from the server.
-
selectArticle
Select an article by its unique identifier (including enclosing invalid input: '<' and invalid input: '>') and return its article number and id through the pointer parameter. This is achieved through the STAT command. According to RFC 977, this will NOT set the current article pointer on the server. To do that, you must reference the article by its number.- Parameters:
articleId
- The unique article identifier of the article that is being selectedd. If this parameter is null, the body of the current article is selectedpointer
- A parameter through which to return the article's number and unique id. The articleId field cannot always be trusted because of server deviations from RFC 977 reply formats. You may set this parameter to null if you do not desire to retrieve the returned article information.- Returns:
- True if successful, false if not.
- Throws:
NNTPConnectionClosedException
- If the NNTP server prematurely closes the connection as a result of the client being idle or some other reason causing the server to send NNTP reply code 400. This exception may be caught either as an IOException or independently as itself.IOException
- If an I/O error occurs while either sending a command to the server or receiving a reply from the server.
-
selectArticle
Same asselectArticle(articleId, null)
- Throws:
IOException
-
selectArticle
Same asselectArticle(null, articleId)
. Useful for retrieving the current article number.- Throws:
IOException
-
selectArticle
Select an article in the currently selected newsgroup by its number. and return its article number and id through the pointer parameter. This is achieved through the STAT command. According to RFC 977, this WILL set the current article pointer on the server. Use this command to select an article before retrieving it, or to obtain an article's unique identifier given its number.- Parameters:
articleNumber
- The number of the article to select from the currently selected newsgroup.pointer
- A parameter through which to return the article's number and unique id. Although the articleId field cannot always be trusted because of server deviations from RFC 977 reply formats, we haven't found a server that misformats this information in response to this particular command. You may set this parameter to null if you do not desire to retrieve the returned article information.- Returns:
- True if successful, false if not.
- Throws:
NNTPConnectionClosedException
- If the NNTP server prematurely closes the connection as a result of the client being idle or some other reason causing the server to send NNTP reply code 400. This exception may be caught either as an IOException or independently as itself.IOException
- If an I/O error occurs while either sending a command to the server or receiving a reply from the server.
-
selectArticle
Same asselectArticle(articleNumber, null)
- Throws:
IOException
-
selectPreviousArticle
Select the article preceeding the currently selected article in the currently selected newsgroup and return its number and unique id through the pointer parameter. Because of deviating server implementations, the articleId information cannot be trusted. To obtain the article identifier, issue aselectArticle(pointer.articleNumber, pointer)
immediately afterward.- Parameters:
pointer
- A parameter through which to return the article's number and unique id. The articleId field cannot always be trusted because of server deviations from RFC 977 reply formats. You may set this parameter to null if you do not desire to retrieve the returned article information.- Returns:
- True if successful, false if not (e.g., there is no previous article).
- Throws:
NNTPConnectionClosedException
- If the NNTP server prematurely closes the connection as a result of the client being idle or some other reason causing the server to send NNTP reply code 400. This exception may be caught either as an IOException or independently as itself.IOException
- If an I/O error occurs while either sending a command to the server or receiving a reply from the server.
-
selectPreviousArticle
Same asselectPreviousArticle(null)
- Throws:
IOException
-
selectNextArticle
Select the article following the currently selected article in the currently selected newsgroup and return its number and unique id through the pointer parameter. Because of deviating server implementations, the articleId information cannot be trusted. To obtain the article identifier, issue aselectArticle(pointer.articleNumber, pointer)
immediately afterward.- Parameters:
pointer
- A parameter through which to return the article's number and unique id. The articleId field cannot always be trusted because of server deviations from RFC 977 reply formats. You may set this parameter to null if you do not desire to retrieve the returned article information.- Returns:
- True if successful, false if not (e.g., there is no following article).
- Throws:
NNTPConnectionClosedException
- If the NNTP server prematurely closes the connection as a result of the client being idle or some other reason causing the server to send NNTP reply code 400. This exception may be caught either as an IOException or independently as itself.IOException
- If an I/O error occurs while either sending a command to the server or receiving a reply from the server.
-
selectNextArticle
Same asselectNextArticle(null)
- Throws:
IOException
-
listNewsgroups
List all newsgroups served by the NNTP server. If no newsgroups are served, a zero length array will be returned. If the command fails, null will be returned.- Returns:
- An array of NewsgroupInfo instances containing the information for each newsgroup served by the NNTP server. If no newsgroups are served, a zero length array will be returned. If the command fails, null will be returned.
- Throws:
NNTPConnectionClosedException
- If the NNTP server prematurely closes the connection as a result of the client being idle or some other reason causing the server to send NNTP reply code 400. This exception may be caught either as an IOException or independently as itself.IOException
- If an I/O error occurs while either sending a command to the server or receiving a reply from the server.
-
listNewNewsgroups
List all new newsgroups added to the NNTP server since a particular date subject to the conditions of the specified query. If no new newsgroups were added, a zero length array will be returned. If the command fails, null will be returned.- Parameters:
query
- The query restricting how to search for new newsgroups.- Returns:
- An array of NewsgroupInfo instances containing the information for each new newsgroup added to the NNTP server. If no newsgroups were added, a zero length array will be returned. If the command fails, null will be returned.
- Throws:
NNTPConnectionClosedException
- If the NNTP server prematurely closes the connection as a result of the client being idle or some other reason causing the server to send NNTP reply code 400. This exception may be caught either as an IOException or independently as itself.IOException
- If an I/O error occurs while either sending a command to the server or receiving a reply from the server.
-
listNewNews
List all new articles added to the NNTP server since a particular date subject to the conditions of the specified query. If no new new news is found, a zero length array will be returned. If the command fails, null will be returned. You must add at least one newsgroup to the query, else the command will fail. Each String in the returned array is a unique message identifier including the enclosing invalid input: '<' and invalid input: '>'.- Parameters:
query
- The query restricting how to search for new news. You must add at least one newsgroup to the query.- Returns:
- An array of String instances containing the unique message identifiers for each new article added to the NNTP server. If no new news is found, a zero length array will be returned. If the command fails, null will be returned.
- Throws:
NNTPConnectionClosedException
- If the NNTP server prematurely closes the connection as a result of the client being idle or some other reason causing the server to send NNTP reply code 400. This exception may be caught either as an IOException or independently as itself.IOException
- If an I/O error occurs while either sending a command to the server or receiving a reply from the server.
-
completePendingCommand
There are a few NNTPClient methods that do not complete the entire sequence of NNTP commands to complete a transaction. These commands require some action by the programmer after the reception of a positive preliminary command. After the programmer's code completes its actions, it must call this method to receive the completion reply from the server and verify the success of the entire transaction.For example
writer = client.postArticle(); if(writer == null) // failure return false; header = new SimpleNNTPHeader("foobar@foo.com", "Just testing"); header.addNewsgroup("alt.test"); writer.write(header.toString()); writer.write("This is just a test"); writer.close(); if(!client.completePendingCommand()) // failure return false;
- Returns:
- True if successfully completed, false if not.
- Throws:
NNTPConnectionClosedException
- If the NNTP server prematurely closes the connection as a result of the client being idle or some other reason causing the server to send NNTP reply code 400. This exception may be caught either as an IOException or independently as itself.IOException
- If an I/O error occurs while either sending a command to the server or receiving a reply from the server.
-
postArticle
Post an article to the NNTP server. This method returns a DotTerminatedMessageWriter instance to which the article can be written. Null is returned if the posting attempt fails. You should check isAllowedToPost() before trying to post. However, a posting attempt can fail due to malformed headers.You must not issue any commands to the NNTP server (i.e., call any (other methods) until you finish writing to the returned Writer instance and close it. The NNTP protocol uses the same stream for issuing commands as it does for returning results. Therefore the returned Writer actually writes directly to the NNTP connection. After you close the writer, you can execute new commands. If you do not follow these requirements your program will not work properly.
Different NNTP servers will require different header formats, but you can use the provided SimpleNNTPHeader class to construct the bare minimum acceptable header for most news readers. To construct more complicated headers you should refer to RFC 822. When the Java Mail API is finalized, you will be able to use it to compose fully compliant Internet text messages. The DotTerminatedMessageWriter takes care of doubling line-leading dots and ending the message with a single dot upon closing, so all you have to worry about is writing the header and the message.
Upon closing the returned Writer, you need to call completePendingCommand() to finalize the posting and verify its success or failure from the server reply.
- Returns:
- A DotTerminatedMessageWriter to which the article (including header) can be written. Returns null if the command fails.
- Throws:
IOException
- If an I/O error occurs while either sending a command to the server or receiving a reply from the server.
-
forwardArticle
- Throws:
IOException
-
logout
Logs out of the news server gracefully by sending the QUIT command. However, you must still disconnect from the server before you can open a new connection.- Returns:
- True if successfully completed, false if not.
- Throws:
IOException
- If an I/O error occurs while either sending a command to the server or receiving a reply from the server.
-