This week's book giveaway is in the OCAJP 8 forum.
We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line!
See this thread for details.
The moose likes Sockets and Internet Protocols and the fly likes IRC Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of OCA Java SE 8 Programmer I Study Guide this week in the OCAJP 8 forum!
JavaRanch » Java Forums » Java » Sockets and Internet Protocols
Bookmark "IRC" Watch "IRC" New topic


Raja Islam
Ranch Hand

Joined: Dec 07, 2001
Posts: 74
i want to connect to irc using sockets but it is not workign my MIRC is working fine but there is some problem it output NOTICE AUTH :*** Looking up your hostname... NOTICE AUTH :*** Checking Ident NOTICE AUTH :*** Found your hostname
ERROR :Closing Link: (Ping timeout)
public class IRCConnection
private String host;
private int port;
public static void main(String[] args) throws UnknownHostException, IOException
new IRCConnection("", 6662 );
public IRCConnection( String host, int port )
throws UnknownHostException, IOException
{ = host;
this.port = port;
private PrintStream out;
private void connect() throws UnknownHostException, IOException

Socket socket = new Socket(host,port);
out = new PrintStream( socket.getOutputStream() );
InputStream x=socket.getInputStream();
DataInputStream xy=new DataInputStream(x);
String line;

private void register()
String nickname = "test";
String localhost = "localhost";
out.println( "USER" + " " + nickname + " " + localhost + " " + host + " " + nickname );
out.println( "NICK" + " " + nickname);

i think it is not problem of port cause MIRC is workign fine on same port.
I agree. Here's the link:
subject: IRC
It's not a secret anymore!