File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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 REST with Spring (video course) this week in the Spring 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.
Don't get me started about those stupid light bulbs.
subject: IRC
It's not a secret anymore!