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 Murach's Java Servlets and JSP this week in the Servlets 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.
It is sorta covered in the JavaRanch Style Guide.
subject: IRC
Similar Threads
Sockets vs URL Based classes
simple socket programming
Java client socket to talk to C server socket
How to Change the File Name for Each Uploaded Files to the Socket Server?
Client-Server Problem