Java IRC channels?

I doubt this, as I've searched google many times looking for one with no luck. Are there any irc channels for java programmers where one can ask quick questions, or just talk about java in general? Something for quick answers to simple questions? Google searches only come up with millions of different java based irc clients, and how to create them.

send a message to the nickserv for help on registering your IRC nick.
/msg NickServ help register
/msg NickServ help identify
Once you've registered your nick, you'll be able to access the ##java chatroom

Similar Messages

  • DPS 11.1.1.5.0 java.nio.channels.ClosedChannelException

    Hi,
    I've upgraded today to 11.1.1.5.0 all my DS and DPS from 11.1.1.3.0 on Redhat 5.6 x64, Java(TM) SE Runtime Environment (build 1.6.0_27-b07)
    I get this on my proxy after a while:
    [29/Aug/2011:17:08:08 +0300] - BACKEND - WARN - Attempt to bind as to backend server ldap.example.com:389/ on connection server-example:124 failed. java.nio.channels.ClosedChannelException
    [29/Aug/2011:17:08:08 +0300] - BACKEND - WARN - Attempt to bind as to backend server ldap.example.com:389/ on connection server-example:124 failed. java.nio.channels.ClosedChannelException
    On the LDAP server I get
    [29/Aug/2011:17:22:49 +0300] conn=91 op=766568 msgId=1 - SRCH base="" scope=0 filter="(objectClass=*)" attrs="1.1"
    [29/Aug/2011:17:22:49 +0300] conn=91 op=766568 msgId=1 - RESULT err=0 tag=101 nentries=1 etime=0
    which is DOSing my log file.
    If I restart the proxy server the problem is gone for a while but it gets back after an hour or so thus making my whole LDAP infrastructure unusable.
    regards,
    Giannis

    I disabled proactive monitor for failed server and the problem didn't occur for 15 hours. Then I got the following.
    Just for the record, ldap.example.com is running on the same machine as DPS.
    [30/Aug/2011:09:08:04 +0300] - BACKEND - WARN - Attempt to bind as to backend server ldap.example.com:389/ on connection server-example:165 failed. java.nio.channels.ClosedChannelException
    [30/Aug/2011:09:08:04 +0300] - BACKEND - WARN - Attempt to bind as to backend server ldap.example.com:389/ on connection server-example:165 failed. java.nio.channels.ClosedChannelException
    [30/Aug/2011:09:08:04 +0300] - BACKEND - WARN - Attempt to bind as to backend server ldap.example.com:389/ on connection server-example:165 failed. java.nio.channels.ClosedChannelException
    [30/Aug/2011:09:08:04 +0300] - BACKEND - WARN - Attempt to bind as to backend server ldap.example.com:389/ on connection server-example:165 failed. java.nio.channels.ClosedChannelException
    [30/Aug/2011:09:08:05 +0300] - EXCEPTION - ERROR - Fatal uncaughtException in Worker Thread 25. Abandon current operation.
    [30/Aug/2011:09:08:05 +0300] - BACKEND - WARN - Attempt to bind as to backend server ldap.example.com:389/ on connection server-example:165 failed. java.nio.channels.ClosedChannelException
    [30/Aug/2011:09:08:06 +0300] - EXCEPTION - ERROR - Fatal uncaughtException in Worker Thread 36. Abandon current operation.
    [30/Aug/2011:09:08:07 +0300] - EXCEPTION - INFO - Fatal uncaughtException in Connection Handler 0 for Listener Thread 0.0.0.0:1636
    Exception thrown from thread Connection Handler 0 for Listener Thread 0.0.0.0:1636 java.lang.OutOfMemoryError: GC overhead limit exceeded
    [30/Aug/2011:09:08:07 +0300] - EXCEPTION - ERROR - Fatal uncaughtException in Connection Handler 0 for Listener Thread 0.0.0.0:1636. Disconnecting all client connections.
    [30/Aug/2011:09:08:08 +0300] - EXCEPTION - INFO - Fatal uncaughtException in Connection Handler 1 for Listener Thread 0.0.0.0:1636
    Exception thrown from thread Connection Handler 1 for Listener Thread 0.0.0.0:1636 java.lang.OutOfMemoryError: GC overhead limit exceeded
    [30/Aug/2011:09:08:08 +0300] - EXCEPTION - ERROR - Fatal uncaughtException in Connection Handler 1 for Listener Thread 0.0.0.0:1636. Disconnecting all client connections.
    [30/Aug/2011:09:08:16 +0300] - EXCEPTION - INFO - Fatal uncaughtException in Proactive Monitor for ds.example.com:636/
    Exception thrown from thread Proactive Monitor for ds.example.com:636/ java.lang.OutOfMemoryError: Java heap space
    [30/Aug/2011:09:08:16 +0300] - EXCEPTION - INFO - Fatal uncaughtException in Proactive Monitor for dscc.example.com:3998/
    Exception thrown from thread Proactive Monitor for dscc.example.com:3998/ java.lang.OutOfMemoryError: Java heap space
    [30/Aug/2011:09:08:16 +0300] - EXCEPTION - INFO - Fatal uncaughtException in Proactive Monitor for dscc.example.com:3998/
    Exception thrown from thread Proactive Monitor for dscc.example.com:3998/ java.lang.OutOfMemoryError: Java heap space
    [30/Aug/2011:09:08:16 +0300] - EXCEPTION - ERROR - Fatal uncaughtException in Proactive Monitor for ds.example.com:636/. No more monitoring running on ds.example.com:636/
    [30/Aug/2011:09:08:16 +0300] - EXCEPTION - ERROR - Fatal uncaughtException in Proactive Monitor for dscc.example.com:3998/. No more monitoring running on dscc.example.com:3998/
    [30/Aug/2011:09:08:17 +0300] - EXCEPTION - INFO - Fatal uncaughtException in Proactive Monitor for ldap.example.com:2389/
    Exception thrown from thread Proactive Monitor for ldap.example.com:2389/ java.lang.OutOfMemoryError: Java heap space
    [30/Aug/2011:09:08:17 +0300] - EXCEPTION - INFO - Fatal uncaughtException in Proactive Monitor for ldapexample.com:3389/
    Exception thrown from thread Proactive Monitor for ldap.example.com:3389/ java.lang.OutOfMemoryError: GC overhead limit exceeded
    I changed all servers to reactive monitor and will see what's going on.
    Giannis

  • Java.nio.channels.ClosedChannelException using https

    Hello,
    I have deployed an application to the OC4J 10.1.3.40, it runs well as long as it is used by http. Since it is running under https an error comes randomly.
    Here is the text from the log.xml:
    <MSG_TEXT>Exception in NIOServerSocketDriver:selectForRead</MSG_TEXT>
    <SUPPL_DETAIL><![CDATA[java.nio.channels.ClosedChannelException
         at java.nio.channels.spi.AbstractSelectableChannel.configureBlocking(AbstractSelectableChannel.java:252)
         at oracle.oc4j.network.NIOServerSocketDriver$SelectorThreadTask.selectForRead(NIOServerSocketDriver.java:331)
         at oracle.oc4j.network.NIOServerSocketDriver.selectForRead(NIOServerSocketDriver.java:58)
         at oracle.oc4j.network.ServerSocketAcceptHandler.persistConnection(ServerSocketAcceptHandler.java:389)
         at oracle.oc4j.network.ServerSocketAcceptHandler.endReadHandlerRun(ServerSocketAcceptHandler.java:409)
         at oracle.oc4j.network.ServerSocketReadHandler$SafeRunnable.run(ServerSocketReadHandler.java:275)
         at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:303)
         at java.lang.Thread.run(Thread.java:619)
    ]]></SUPPL_DETAIL>
    Can anybody help me?
    Regards
    Jens

    Jens,
    Can you turn up your debug level to FINEST? It appears that during the read operation an attempt to access a channel closed to read occurs.
    // Create binding -- set binding properties before you open the factory.
    OracleDBBinding odbBinding = new OracleDBBinding();
    // Create address.
    EndpointAddress odbAddress = new EndpointAddress("oracledb://ADAPTER/");
    // Create channel factory from binding and address.
    ChannelFactory<IRequestChannel> factory =
        new ChannelFactory<IRequestChannel>(odbBinding, odbAddress);
    // Specify credentials.
    factory.Credentials.UserName.UserName = "SCOTT";
    factory.Credentials.UserName.Password = "TIGER";
    // Open factory
    factory.Open();
    // Get channel and open it.
    IRequestChannel channel = factory.CreateChannel();
    channel.Open();-Michael

  • Java.nio.channels.IllegalBlockingModeException

    I am using selector for read and PrintWriter writer = new PrintWriter(new OutputStreamWriter(sc.getOutputStream()),true) for writing to the socket and I get this exception at write statement. Can anyone suggest me what should I do??
    java.nio.channels.IllegalBlockingModeException
    at java.nio.channels.Channels.write(Channels.java:59)
    at java.nio.channels.Channels.access$000(Channels.java:47)
    at java.nio.channels.Channels$1.write(Channels.java:134)
    at sun.nio.cs.StreamEncoder$CharsetSE.writeBytes(StreamEncoder.java:334)
    at sun.nio.cs.StreamEncoder$CharsetSE.implFlushBuffer(StreamEncoder.java
    :402)
    at sun.nio.cs.StreamEncoder$CharsetSE.implFlush(StreamEncoder.java:406)
    at sun.nio.cs.StreamEncoder.flush(StreamEncoder.java:150)
    at java.io.OutputStreamWriter.flush(OutputStreamWriter.java:213)
    at java.io.PrintWriter.newLine(PrintWriter.java:256)
    at java.io.PrintWriter.println(PrintWriter.java:405)
    at java.io.PrintWriter.println(PrintWriter.java:516)
    at SktChannelTest3.run(SktChannelTest3.java:91)

    Hi,
    Thanx for the reply. I am using Selecotor for read and if it timesout I used PrintWriter to write to Socket ( Not socket channel). So, once it comes out of select loop, it'd excecute PrintWriter.println("Timeout message....") statement. And at this statement I/m getting exception.

  • Java.nio.channels.NonWritableChannelException

    i have been facing this exception, please tell me how to remove it
    java.nio.channels.NonWritableChannelException
    here is my code
    import java.io.*;
    import java.nio.*;
    import java.nio.channels.*;
    public class abc
         public static void main(String arg[])
              try
              File ff=new File("aaa.txt");
              FileInputStream fis=new FileInputStream(ff);
              FileChannel fc=fis.getChannel();
              FileLock lock=fc.lock();
              lock.release();
              fc.close();
              catch(Exception e)
                   System.out.println("hello22"+e);
    }

    what should i do then to make the channel writable . please tell me what to change in the code, i just want to lock the file and after that i will modify it.

  • Java.nio.channels.FileChannel jar file

    Hi
    I have used java.nio.channels.FileChannel package in my program.
    where can I get the jar file which has the above package?
    Thanx

    i give here sample code.. use this it will work fine..
    import java.nio.*;
    import java.nio.channels.*;
    import java.io.*;
    public class copyImage
    public static void main(String [] args) throws IOException
    try {
    // Create channel on the source
    FileChannel srcChannel = new FileInputStream("dragonfly.jpg").getChannel();
    FileChannel dstChannel =new FileOutputStream("1.jpg").getChannel();
    // Copy file contents from source to destination
    dstChannel.transferFrom(srcChannel, 0, srcChannel.size());
    // Close the channels
    srcChannel.close();
    dstChannel.close();
    } catch (IOException e) {
    }

  • Java.nio.channels.Pipe?

    Someone explain what java.nio.channels.Pipe should be uses for, and how to use it?

    You can use this class to transfer the content of a channel from one thread to another thread.
    The writing thread blocks when the pipe is full.
    package com.desoft.pipetest;
    import java.io.*;
    import java.nio.*;
    import java.nio.channels.*;
    public class PipeTest {
    public static void main (String args[])
    try
    FileInputStream fis = new FileInputStream(args[0]);
    FileChannel fc = fis.getChannel();
    Pipe p = Pipe.open();
    PipeReader pr = new PipeReader( p );
    Thread t = new Thread( pr );
    t.start();
    fc.transferTo(0, fc.size(), p.sink() );
    catch( IOException ioe )
    ioe.printStackTrace();
    * Read from a Pipe and write Content to System.out
    static class PipeReader implements Runnable
    Pipe p;
    public PipeReader( Pipe p )
    this.p = p;
    public void run()
    try
    ByteBuffer buffer = ByteBuffer.allocate( 10 );
    int len = 0;
    while( (len=p.source().read( buffer )) > 0 )
    buffer.rewind();
    for( int i = 0; i < len; i++ )
    System.out.print( (char)buffer.get());
    buffer.rewind();
    catch( IOException ioe )
    ioe.printStackTrace();

  • SAP IRC channel at Freenode

    hello i just want make notice that some ppl create a new ( and still little ) channel in irc network freenode #sap ; i will post the topic of the channel for you get idea what is the point of this channel:
    "Free, Friendly SAP support and advice - ask  away! (e.g. NetWeaver - Business One - ABAP - PI - BASIS - HCM)"
    right now we are just few ppl but with you help will become more and make a nice/fast place where find help.
    note: here the IRC FAQ if somebody don't how this work:
    http://irchelp.org/irchelp/altircfaq.html
    Edited by: Edgar Almonte on Sep 28, 2009 7:54 PM

    >
    Julius Bussche wrote:
    > Personally I prefer the forums here.
    >
    > - Folks from SAP read them and also contribute.
    > - They are moderated, because bad advise is also for free.
    > - Others who use the search can benefit and contribute to it as well.
    >
    > I can assure you that there is a lot of crap out there in the internet... and a lot of folks who will post it because they are guessing or just spammers regurgitating urban legends.
    >
    > We have them here at SDN as well, but generally they don't get away with it.
    >
    > Personally I would not use such an IRC site.
    >
    > A popular exception is twitter, but there (as in SDN) you need to be carefull who you follow and who follows you.
    >
    > My 2 cents,
    > Julius
    you argument are very valid and i can't not invalid it , but how you say the here are crap in internet ( a lot of then ) but the years i have in internet one of the tool that give me more community sense is IRC , is a real-time interaction between ppl that want just share ( anything ) and even there are way to moderate the channels so that kind of problem that you can see in irc  exist too in sdn forum and in both place can be somehow controlled so i don't see this a problem
    the quality of the info need to confirm by the requester, you need have some common sense of doing things the sdn forum try to solve this with the P_O_IN_TS  system that i think is quite broken system because ppl just answer the anything to  expect hit the pot and get P_O_IN_TS .
    i not the founder of the irc channel but of what i talk to the ppl there they want not just make a channel they want build a better community of sap user thing that from my point of view SDN is fail of do this.
    my 2 cents.
    E0x

  • Troubles with timeout using java.nio.channels and non-blocking sockets

    Hello.
    I have a server application that employs java.nio.channels with non-blocking sockets.
    The server waits for connections. The client should connect and be first in sending data.
    Timeouts are significant! If client exceeds the allowed time to send data, the server should break the connection.
    The huge trouble I've discovered that I cannot control the timeout when client connects but remains silent.
    My code looks as follows:
    <pre>
    Selector oSel;
    SocketChannel oSockChan;
    Socket oSock;
    SelectionKey oSelKey;
    Iterator<SelectionKey> oItSelKeys;
    int iCurrState, iMask, iCount;
    iCurrState = INT_SERVER_WORKING;
    iMask = SelectionKey.OP_ACCEPT | SelectionKey.OP_CONNECT | SelectionKey.OP_READ | SelectionKey.OP_WRITE;
    while ( iCurrState == INT_SERVER_WORKING )
    try
    *// retrieving next action*
    iCount = oSel.select();
    if ( iCount > 0 )
    oItSelKeys = oSel.selectedKeys().iterator();
    while ( oItSelKeys.hasNext() )
    oSelKey = oItSelKeys.next();
    oItSelKeys.remove();
    if ( oSelKey.isValid() )
    switch ( oSelKey.readyOps() & iMask ) {
    case SelectionKey.OP_ACCEPT :
    oSockChan = oSSockChan.accept();
    oSockChan.configureBlocking(false);
    oSock = oSockChan.socket();
    oSock.setKeepAlive(true);
    oSockChan.register(oSel,SelectionKey.OP_READ,new MyPacket(oSock.getInetAddress(),oSock.getPort()));
    break;
    case SelectionKey.OP_READ :
    oSelKey.interestOps(0);
    ((MyPacket) oSelKey.attachment()).inRequest(); *// preparing request*
    this.getReader().add(oSelKey); *// sending key to reading thread*
    break;
    case SelectionKey.OP_WRITE :
    oSelKey.interestOps(0);
    ((MyRequest) oSelKey.attachment()).inResponse(); *// preparing response*
    this.getWriter().add(oSelKey); *// sending key to writing thread*
    break;
    case SelectionKey.OP_CONNECT :
    default :
    *// nothing to do*
    catch ( IOException oExcept )
    *// do some actions*
    </pre>
    Timeouts are easily controlled by reading and writing threads (see OP_READ and OP_WRITE ).
    But when a client just connects without consequent data send, the state of this connection remains as OP_ACCEPT. The connection remains open for arbitrarily large time and I cannot control it!
    Please help with idea how can I terminate such connections!

    How can I process the keys that weren't selected at the bottom of the loop? Should I use the method keys() ?Yes. Form a new set from keys() and removeAll(selectedKeys()). Do that before you process selectedKeys().
    And the second moment: as I understood a single key may contain several operations simultaneously? Thus I should use several if's (but not if/else 'cause it's the equivalent of switch ... case ).If there is anything unclear about 'your switch statement is invalid. You need an if/else chain' I fail to see what it is. Try reading it again. And if several ifs were really the equivalent of "switch ... case", there wouldn't be a problem in the first place. They're not, and there is.

  • Yesterday Colloquy crashed on my iPad after an Arabic text string was pasted into the IRC channel that I was on. Another user using Linkinus was also affected. As I understand it, this vulnerability has to do with Webkit. What is being done about it?

    Yesterday Colloquy crashed on my iPad after an Arabic text string was pasted into the IRC channel that I was on. Another user using Linkinus under Mountain Lion on her Macbook Pro was also affected. As I understand it, this vulnerability has to do with applications that use Webkit. What is being done about it? Can we expect security updates for Mountain Lion and iOS 6 soon?

    AFAIK, there has not been an update regarding this issue as yet.
    Rendering bug crashes OS X, iOS apps with string of Arabic characters (Updated) | Ars Technica
    You can send feedback to Apple >  Apple - Mac OS X - Feedback

  • Java IRC bot.

    hi, recently I started making an irc bot in Java. I was testing it out on my friend's server and everything seemed to be working, it was reading from the server, and was responding to the one command. I wanted to show it to my other friend so I changed the variables to match his irc server, and the bot couldn't connect. I was wondering if the problem was in my friend's server or in my code. (I'll include what the server sends when I connect at the bottom)
    package ircbot;
    import java.io.BufferedReader;
    import java.io.BufferedWriter;
    import java.io.IOException;
    import java.io.InputStream;
    import java.io.InputStreamReader;
    import java.io.OutputStream;
    import java.io.OutputStreamWriter;
    import java.net.Socket;
    import java.net.UnknownHostException;
    import java.util.Scanner;
    public class bot {
        public static String message;
        /* variables */
        Socket sock;
        OutputStream out;
        BufferedWriter writer;
        InputStream in;
        BufferedReader reader;
        static doaction action = new doaction();
        String nick = "Gary";
        String user = "account 8 * :oHai";
        public static String channel = "#malvager";
        String ip = "127.0.0.1"; // <-- not the actual ip...
        int port = 11235;
        /* end variable and object declarations */
        public static void main(String[] args) {
            bot superbot = new bot();
            superbot.connect();
        public void connect() {
            try {
            sock = new Socket(ip, port);
            out = sock.getOutputStream();
            writer = new BufferedWriter(new OutputStreamWriter(out));
            in = sock.getInputStream();
            reader = new BufferedReader(new InputStreamReader(in));
            join(nick, channel, user, writer, reader);
            } catch (UnknownHostException e) {
                e.printStackTrace();
            } catch (IOException i) {
                i.printStackTrace();
            }// end try/catch
        public static void join(String nick, String channel, String user, BufferedWriter writer, BufferedReader reader) {
            try {
                writer.write("NICK " + nick);
                System.out.println("set nick");
                writer.newLine();
                writer.flush();
                System.out.println(reader.readLine());
                writer.write("USER " + user);
                System.out.println("set user");
                writer.newLine();
                writer.flush();
                System.out.println(reader.readLine());
                writer.write("JOIN " + channel);
                System.out.println("joined channel");
                writer.newLine();
                writer.flush();
                System.out.println(reader.readLine());
                read(reader, writer);
            } catch (IOException e) {
                e.printStackTrace();
        public static void read(BufferedReader reader, BufferedWriter writer) {
            String said;
            while(1 == 1) {
                try {
                    said = reader.readLine();
                    System.out.println(said);
                    if (check(said) == true) {
                        print(writer);
                } catch (IOException f) {
                    f.printStackTrace();
        public static boolean check(String input) {
            message = action.setinput(input);
            if (message.equals("I'm awesome")) {
                return(true);
            } else {
                return(false);
        public static void print(BufferedWriter writer) {
            Scanner input = new Scanner(System.in);
           try {
               writer.write("PRIVMSG " + channel + " " + message);
               writer.newLine();
               writer.flush();
           } catch(IOException r) {
               r.printStackTrace();
    }// end class
    package ircbot;
    import java.lang.String;
    public class doaction {
        public String setinput(String input) {
            int length = input.length();
            int control;
            String message = input;
            control = length - 5;
            message = message.substring(control, length);
            if (message.equals("!Gary")) {
                message = "I'm awesome";
                return(message);
            } else {
                message = input;
                return("bad");
    }When I connect to my second friend's server (the one that doesn't work) I get:
    set nick
    :lolnepp.no-ip.biz NOTICE AUTH :*** Looking up your hostname...
    set user
    :lolnepp.no-ip.biz NOTICE AUTH :*** Found your hostname (cached)
    joined channel
    PING :51AA6A7F
    :lolnepp.no-ip.biz 451 JOIN :You have not registered
    When I connect to the friend's server that works I get:
    set nick
    :Malvager.hub NOTICE AUTH :*** Looking up your hostname...
    set user
    :Malvager.hub NOTICE AUTH :*** Found your hostname
    joined channel
    :Malvager.hub 001 Gary :Welcome to the Malvager-IRC-Network IRC Network [email protected]
    :Malvager.hub 002 Gary :Your host is Malvager.hub, running version Unreal3.2.7
    :Malvager.hub 003 Gary :This server was created Sun Oct 26 2008 at 00:01:26 PDT
    :Malvager.hub 004 Gary Malvager.hub Unreal3.2.7 iowghraAsORTVSxNCWqBzvdHtGp
    Okay yea, can anyoen tell me if the problem is in my code or the server? And if the problem is in the code could you please tell me what to change or point me in the right directin? thanks.

    kajbj wrote:
    youngdeveloper wrote:
    What do you mean it doesn't look like a java program..? Sorry, I was watching tv while I was typing. It should say "Java problem" and not "Java program" :)
    And yea, I realize it says that, but the steps to register are you enter the nick and the user which both come before that, so I was wondering if anyone with knowledge of how irc works could tell me if there's some other way of registering, or if the problem's in my code.Some IRC servers requires that an admin in the channel creates the user account.
    KajOkay, glad to know it was supposed to say program :).
    I'm pretty sure that it's not because the admin has to set up the acc. because this server was set up with the sole purpose of showing my friend my bot. However, it might be just that the server is retarded. I'm gonna try it on some other servers and see how it works there.

  • Java irc bot problems

    Hello,
    Im trying to write a irc bot in java. So far it works well. I am trying to test
    for a quiet room. If room is quiet I want my bot to say something. Only problem
    is that my test for "quiet" are not working. Could someone take a look and
    tell me what Im doing wrong.
    Thanks,
    jd
    import java.io.BufferedReader;
    import java.io.PrintWriter;
    import java.io.InputStreamReader;
    import java.net.*;
    import java.io.*;
    import java.util.regex.*;
    import java.util.Vector;
    public class MySocket{
      Socket socket = null;
      BufferedReader in = null;
      PrintStream out = null;
      InetAddress inaddr = null;
      int mpt = 6667;   
    public MySocket(){
      String inet_string = new String("X.X.X.X"); //ip of irc server
      Vector myConnection = makeConnection(inet_string);
      BufferedReader psIn =  (BufferedReader) myConnection.elementAt(0);
      PrintStream psOut = (PrintStream) myConnection.elementAt(1);
      String command = new String("USER " + "mohadib67854" + " 0 0 :" + "mohadib");
      cmdSend(psOut , command);
      command = "NICK " + "javabot" + " 0";
      cmdSend(psOut , command);
      command = "JOIN #bot_test";
      cmdSend(psOut , command);
      String matchString = null;
      boolean end = false;
      while(!end){
       Pattern pattern = Pattern.compile(".{1,}:End of /NAMES list.{0,}");
       try{
        matchString = psIn.readLine();
       }catch(Exception e){
        System.out.println(e);
       Matcher matcher = pattern.matcher(matchString);
       System.out.println(matchString);
       end = matcher.matches();
      //say hello
      command = "PRIVMSG #bot_test :Hello";
      cmdSend( psOut , command);
      // now go to listen and process loop
      listen(psIn , psOut);
    } // close consructtor
    public void listen(BufferedReader psIn , PrintStream psOut){
      boolean end = false;
      String matchString = null;
      while(!end){
       try{
        matchString = psIn.readLine();
       }catch(Exception e){
        System.out.println(e);
       // print all buffer to console
       System.out.println(matchString);
       //ping
       Pattern pattern = Pattern.compile("^PING.{1,}");
       Matcher matcher = pattern.matcher(matchString);
       boolean ping = false;
       ping = matcher.matches();
       if(ping){
        String command = new String("PONG");
        cmdSend(psOut , command);
        continue;
       // room is quite
      /* pattern = Pattern.compile("");
       matcher = pattern.matcher(matchString);
       boolean quiet = false;
       quiet = matcher.matches(); */
       if(matchString == null){
        String command = new String("PRIVMSG #bot_test :zzz");
        cmdSend(psOut , command);
        continue;
       if(matchString.equals("")){
        String command = new String("PRIVMSG #bot_test :zzz");
        cmdSend(psOut , command);
        continue;
       if(matchString.equals("\n")){
        String command = new String("PRIVMSG #bot_test :zzz");
        cmdSend(psOut , command);
        continue;
       if(matchString.equals("\r")){
        String command = new String("PRIVMSG #bot_test :zzz");
        cmdSend(psOut , command);
        continue;
       // some one said hello to javabot
       boolean hello = false;
       boolean hello_backwards = false;
       pattern = Pattern.compile("^:(.{1,})!.{0,}javabot.{0,}hello.{0,}");
       matcher = pattern.matcher(matchString);
       hello = matcher.matches();
       pattern = Pattern.compile("^:(.{1,})!.{0,}hello.{0,}javabot.{0,}");
       Matcher matcher1 = pattern.matcher(matchString);
       hello_backwards = matcher1.matches();
       if(hello){
        String name = matcher.group(1);
        String command = new String("PRIVMSG #bot_test :Hello " + name);
        cmdSend(psOut , command);
        continue;
       else if(hello_backwards){
        String name = matcher1.group(1);
        String command = new String("PRIVMSG #bot_test :Hello " + name);
        cmdSend(psOut , command);
        continue;
      } //close while
    } // close listen
    public void cmdSend(PrintStream out , String command){
       try{
        out.println(command);
       }catch(Exception e){
        System.out.println(e);
    }// close cmdSend();
    public Vector makeConnection(String inet_string){
      try{
       inaddr = InetAddress.getByName(inet_string);
       socket = new Socket(inaddr,mpt);
       in = new BufferedReader (new InputStreamReader(socket.getInputStream()), 1024 );
       out = new PrintStream (socket.getOutputStream());
      }catch(Exception e){
        System.out.println(e);
      boolean end = false;
      String myIn = null;
      while(!end){
       try{
        myIn = new String(in.readLine());   
       }catch(Exception e){
        System.out.println(e);
       Pattern pattern = Pattern.compile(".{1,}Found your hostname"); // NOTICE AUTH :*** Found your hostname
               Matcher matcher = pattern.matcher(myIn);
       System.out.println(myIn);
       end = matcher.matches();
      // put in and out in a array to return
      Vector psReturn = new Vector();
      psReturn.add(in);
      psReturn.add(out);
      return psReturn;
    } // close makeConnection  
    public static void main(String[] args){
        MySocket ms = new MySocket();
    }

    I believe what you want is a thread that waits for x seconds before doing something (ie say something). If after x seconds the thread hasnt been killed/reset then do something and reset the thread.
    Your listen method should reset the thread everytime its called.
    when I say reset the thread I mean the thread will be doing a wait() and when it wakes up it should check a flag to see whether or not the room is still quiet. Your listen() method should set this flag.
    Thats a broad outline any hoo.
    Ted.
    'Standing in line to see the show tonight, theres a light on, heavy glow'

  • Detect loss of socket connection using java.nio.channels.Selector

    I'm using the nio package to write a "proxy" type application, so I have a ServerSocketChannel listening for incoming connections from a client and then create a SocketChannel to connect to a server. Both SocketChannels are registered to the same Selector for OP_READ requests.
    All works fine, until either the client or server drops the connection. How can I detect this has happened, so my proxy app can drop the other end of the connection ?
    The Selector.select() method is not triggered by this event. I have tried using Selector.select(timeout) and then checking the status of each channel, but they still show isConnected()=true.
    Thanks,
    Phil Blake

    Please don't cross post.
    http://forum.java.sun.com/thread.jsp?thread=184411&forum=4&message=587874

  • [SOLVED] Arch Linux IRC Channel :: how do i register with NickServ?

    I tried following the instrauctions in the wiki but nothing happens.
    I've connected (/connect irc.freenode.net) and joined the channel (/join archlinux) but then when i type a message it says i am unable to send a message to the channel.
    I proceed to try the two commands in the wiki but nothing appears to happen:
    /msg nickserv help register
    /msg nickserv help identify
    What do I need to do exactly?
    Last edited by trusktr (2010-09-19 06:31:55)

    Nickserv should have sent instructions, like so:
    4:58pm -- | -nickserv- help register
    4:58pm -- | NickServ (NickServ@services.): ***** NickServ Help *****
    4:58pm -- | NickServ (NickServ@services.): Help for REGISTER:
    4:58pm -- | NickServ (NickServ@services.):
    4:58pm -- | NickServ (NickServ@services.): This will register your current nickname with NickServ.
    4:58pm -- | NickServ (NickServ@services.): This will allow you to assert some form of identity on
    4:58pm -- | NickServ (NickServ@services.): the network and to be added to access lists. Furthermore,
    4:58pm -- | NickServ (NickServ@services.): NickServ will warn users using your nick without
    4:58pm -- | NickServ (NickServ@services.): identifying and allow you to kill ghosts.
    4:58pm -- | NickServ (NickServ@services.): The password is a case-sensitive password that you make
    4:58pm -- | NickServ (NickServ@services.): up. Please write down or memorize your password! You
    4:58pm -- | NickServ (NickServ@services.): will need it later to change settings.
    4:58pm -- | NickServ (NickServ@services.):
    4:58pm -- | NickServ (NickServ@services.): You have to confirm the email address. To do this,
    4:58pm -- | NickServ (NickServ@services.): follow the instructions in the message sent to the email
    4:58pm -- | NickServ (NickServ@services.): address.
    4:58pm -- | NickServ (NickServ@services.):
    4:58pm -- | NickServ (NickServ@services.): Syntax: REGISTER <password> <email-address>
    4:58pm -- | NickServ (NickServ@services.):
    4:58pm -- | NickServ (NickServ@services.): Examples:
    4:58pm -- | NickServ (NickServ@services.):     /msg NickServ REGISTER bar [email protected]
    4:58pm -- | NickServ (NickServ@services.): ***** End of Help *****
    The responses from Nickserv won't show up in the #archlinux channel. They'll be in another buffer or tab in your IRC client.

  • Is java.nio.channels.FileLock thread safe ?

    Hello,
    I want to lock a file in exclusive mode. The 1.4.2 doc says the followings:
    File locks are held on behalf of the entire Java virtual machine. They are not suitable for controlling access to a file by multiple threads within the same virtual machine.
    File-lock objects are safe for use by multiple concurrent threads.
    I'm confused. If They are not suitable for controlling access to a file by multiple threads within the same virtual machine, How can they be safe for use by multiple concurrent threads ?
    thanks in advance...

    I think it means that you still need to synchronize your threads around the code that obtains the lock and writes data to the file.

Maybe you are looking for

  • Why can't i directly cut and paste album art

    The older I-Tunes was able to cut directly and paste album art pictures, (when the find album album art auto feature failed) I now have to save album images to my hard drive,' Apart from the new coloured (I spell Colored with a "U" as I'm British)  i

  • Workround for Smart Playlist bug in iTunes 6.0.5

    I'm using iTunes 6.0.5 on MacOS 10.2.8 (hence I can't upgrade iTunes to a later version 'cos my OS is too old). When I try to use Smart Playlists, the program closes down whenever I create a Playlist featuring a date-type condition (like "Last Played

  • Twitter button showing 3 sided frame and cutting 4th side short

    So I went to the goodies thing at twitter.com and it has a follow me thing, i believe, that you paste in as an html snippit which i have many of on my sight . . but for some reason the twitter one no matter the button i use when i publish shows a 3 s

  • TS1424 unable to download apps from app store

    I receive a pop up saying "Cannot cooect to iTunes Store". I tried both on my 3G and on Wifi it does the same. I am able to access internet through browser and other apps.

  • Horizontal Axis not showing when initial loading

    Hi, We are on Dashboard 4.1 SP3. I have drilling down configured on the Dashboard report. The issue is when initial loading the dashboard. the horizontal text are not showing completly, untill I click the other column of the parent column, it shows t