You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by Halina Tam <ha...@gmail.com> on 2005/08/19 09:53:42 UTC

Connecting NNTP server

Hi,
I am new to commons-net. I want to connect to a nntp server by using
NNTPClient.connect(), such as:
NNTPClient clinet = new NNTPClient();
client.connect("news://news.eclipse.org/");
client.authenticate("exquisitus", "flinder1f7");

But I always receive UnknownHostException:
java.net.UnknownHostException: news://news.eclipse.org/
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:153)
at java.net.Socket.connect(Socket.java:452)
at java.net.Socket.connect(Socket.java:402)
at java.net.Socket.<init>(Socket.java:309)
at java.net.Socket.<init>(Socket.java:124)
at org.apache.commons.net.DefaultSocketFactory.createSocket(DefaultSocketFactory.java:53)
at org.apache.commons.net.SocketClient.connect(SocketClient.java:162)
at org.apache.commons.net.SocketClient.connect(SocketClient.java:250)
at com.gsta.nntp.reader.NNTPReader.main(NNTPReader.java:29)

And there are three other ways to connect to a server, I dont know how
to use them.

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


Re: Connecting NNTP server

Posted by Michael Katz <ec...@yahoo.com>.
Try without the protocol:
...
client.connect("news.eclipse.org");
...

Halina Tam wrote:
> Hi,
> I am new to commons-net. I want to connect to a nntp server by using
> NNTPClient.connect(), such as:
> NNTPClient clinet = new NNTPClient();
> client.connect("news://news.eclipse.org/");
> client.authenticate("exquisitus", "flinder1f7");
> 
> But I always receive UnknownHostException:
> java.net.UnknownHostException: news://news.eclipse.org/
> at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:153)
> at java.net.Socket.connect(Socket.java:452)
> at java.net.Socket.connect(Socket.java:402)
> at java.net.Socket.<init>(Socket.java:309)
> at java.net.Socket.<init>(Socket.java:124)
> at org.apache.commons.net.DefaultSocketFactory.createSocket(DefaultSocketFactory.java:53)
> at org.apache.commons.net.SocketClient.connect(SocketClient.java:162)
> at org.apache.commons.net.SocketClient.connect(SocketClient.java:250)
> at com.gsta.nntp.reader.NNTPReader.main(NNTPReader.java:29)
> 
> And there are three other ways to connect to a server, I dont know how
> to use them.


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org