30EA1 Dead UI on timed-out connection

This version still has 2.11's "dead UI" behavior on a closed- or timed-out connection to the Oracle database.
I contend that fixing this behavior is more important than any new feature work. It's bad to waste a person's time, and that's what this behavior does. I'd guess recovery from a timed-out connection I just had took seven minutes.
Heaven forbid I should have to make coffee... ;-)

What HWHC said.
Environment:
* Mac OS X 10.6.4.
* SSL VPN over my cable modem to our campus network
* Oracle 11R2 on SuSE
* Connections panel is not "pinned," that is, I summon it by clicking a tab to the left of SD's window.
There are two, maybe three bad UI behaviors related to connectivity:
* Dead UI (this thread): lost connection, time-out, lost network or VPN timed out. 2.11, 3.0EA1.
I simulated this scenario last night by:
- Authenticate to the DB.
- Open a package declaration.
- Leave SD untouched until this morning (required wait time is much less than overnight).
- At 6:36 this morning, close the editor window.
- Summon the Connections panel (which still had the connection's schema open).
- Click the connection name.
- The UI froze: the esc key did not dismiss the Connections panel, no clicks were accepted, clicks in SD's menu changed the cursor to the beachball.
- Do other work. At 6:44 I saw the connections panel finally close, and from then on I could work with it.
If you have time, you switch to another task; if you don't, you use OS X's Force Quit, like HWHC says, and potentially lose work. That's data loss.
Someone was so troubled by this behavior that s/he wrote a "keep alive" plugin. Obviously it's a risk to install a bit of code not vetted by Oracle, so I haven't tried the plugin. Clearly this isn't a rare phenomenon.
* Bonking SQL editor in 30EA1, maybe 2.11:
- Open connection
- Open a package
- Leave SD alone for maybe 10, 15 minutes.
- Then navigate the open package. Attempts to type produce a "bonk" sound -- on the Mac, meaning "No."
- Oddly, I can open other packages but still experience the bonk behavior.
* Smaller annoyance in 2.11, 30EA1: Connections panel schema tree and its context menu get out of sync about connection status. An idled connection name might not offer a Disconnect menu option until you click another connection, then click again the active connection to get the disconnect option.

Similar Messages

  • FTPS receiver side - Connection problem:connection timed out: connect

    Hi experts,
    I must connect to an external server to send files with FTPS.
    I have created receiver CC with connection security: FTPS for control and data connection
    Command order: TLS, USER, PASS, PBSZ, PROT
    Connect mode: per file transfer
    port : 990 (given by third part)
    data connection: passive (suggested by third part)
    My problem is that communication channel raise a connection timed out error, see below for log.
    I've already followed the steps suggested by this thread:
    FTPS Transfer Failing with Connection Timeout
    but no luck.
    Thanks
    Fabio Boni
    2011-05-18 12:21:01 Success Connecting to FTP server "ftps.xxx.xxx.it"
    2011-05-18 12:21:02 Success Write to FTP server "ftps.xxx.xxx.it", directory "/in", -> file "Delivery20110518-122102-155.xml"
    2011-05-18 12:21:02 Success Transfer: "BIN" mode, size 1760 bytes, character encoding -
    2011-05-18 12:21:23 Error Attempt to process file failed with java.net.ConnectException: Connection timed out: connect
    2011-05-18 12:21:23 Error Exception caught by adapter framework: Connection timed out: connect
    2011-05-18 12:21:23 Error MP: Exception caught with cause com.sap.aii.af.ra.ms.api.RecoverableException: Connection timed out: connect: java.net.ConnectException: Connection timed out: connect
    2011-05-18 12:21:23 Error Delivery of the message to the application using connection File_http://sap.com/xi/XI/System failed, due to: com.sap.aii.af.ra.ms.api.RecoverableException: Connection timed out: connect: java.net.ConnectException: Connection timed out: connect.

    As Fabio said, the file adapter log return this log:
    2011-05-18 12:21:01 Success Connecting to FTP server "ftps.xxx.xxx.it"
    2011-05-18 12:21:02 Success Write to FTP server "ftps.xxx.xxx.it", directory "/in", -> file "Delivery20110518-122102-155.xml"
    2011-05-18 12:21:02 Success Transfer: "BIN" mode, size 1760 bytes, character encoding -
    2011-05-18 12:21:23 Error Attempt to process file failed with java.net.ConnectException: Connection timed out: connect
    Seem that FTP access into server is executed successfully and adapter write file, but raise timeout exception.

  • G6 UI Customization build problem - Connection timed out: connect

    For anyone else who's having the same problem we're having:
    When I run ANT on the ui customization folder, I get this error:
    Buildfile: build.xml
    BUILD FAILED
    C:\plumtree_ui_source\portalui\6.0.x\test\build.xml:14: The following error occu
    rred while executing this line:
    Error reading project file C:\plumtree_ui_source\portalui\6.0.x\test\build_core.
    xml: Connection timed out: connect
    Total time: 21 seconds
    We're running behind a proxy.  ANT has to connect to the Java website to pull down it's DTD.  So, the answer is to first run the following command to configure the proxy, replacing the proxy host, port, username, and password with yours:
    set ANT_OPTS=-Xms128m -Xmx800m -DproxySet=true -DproxyHost=10.0.0.0 -DproxyPort=80 -DproxyUser=myUsername -DproxyPass=myPassword

    Thanks for the post, it fixed my issue!

  • OpenMarket sms api gives "Connection timed out: connect"

    Hello All,
    I am new to web applications with sms services.
    I am trying to send sms from my java application to mobile device. But I am getting below error.
    Aug 25, 2010 10:55:58 AM com.eha.sms.ema.EMACMMessageSendProxy init
    INFO: Move to send the receiver initialization.
    Destination address = +**********
    Source addres = +*****
    Sending message to Simplewire...
    REQUEST XML ==
    <?xml version="1.0" ?>
    <request version="3.0" protocol="wmp" type="submit">
         <user agent="Java/SMS/2.9.16"/>
         <account id="******************" password="***************"/>
         <option type="production"/>
         <source ton="0" address="+*****"/>
         <destination ton="0" address="+**********"/>
         <message udhi="false" text="Hello World!"/>
    </request>
    protocol: http
    remote host: ******Some site given to us by open market people that opens on browser**********
    remote port: 8080
    remote file: /wmp
    {main} [10:55:58.722] Conn: added module com.simplewire.http.RetryModule
    {main} [10:55:58.725] Conn: added module com.simplewire.http.AuthorizationModule
    {main} [10:55:58.726] Conn: added module com.simplewire.http.DefaultModule
    {main} [10:55:58.747] Conn: Creating Socket: smsc-01.openmarket.com:8080
    {main} [10:56:19.759] Conn: java.net.ConnectException: Connection timed out: connect
         at java.net.PlainSocketImpl.socketConnect(Native Method)
         at java.net.PlainSocketImpl.doConnect(Unknown Source)
         at java.net.PlainSocketImpl.connectToAddress(Unknown Source)
         at java.net.PlainSocketImpl.connect(Unknown Source)
         at java.net.SocksSocketImpl.connect(Unknown Source)
         at java.net.Socket.connect(Unknown Source)
         at java.net.Socket.connect(Unknown Source)
         at java.net.Socket.<init>(Unknown Source)
         at java.net.Socket.<init>(Unknown Source)
         at com.simplewire.http.HTTPConnection$_A.run(Unknown Source)
    Message was not sent!
    Error Code: 106
    Error Description: A connection could not be established with the Simplewire network. Connection timed out: connect
    Error Resolution:
    The code I am using is as below.
    private void config()
              Properties properties = new Properties();
              InputStream smscmReceiver = EMACMMessageSendProxy.class.getClassLoader().getResourceAsStream("sms.properties");
              try
                   properties.load(smscmReceiver);
                   System.out.println(properties.getProperty("SMS.SubscriberID").trim());
                   System.out.println(properties.getProperty("SMS.Password").trim());
                   System.out.println(properties.getProperty("SMS.DestinationAddress").trim());
                   System.out.println(properties.getProperty("SMS.SourceAddress").trim());
                   SMS sms = new SMS();
                   // subscriber settings
                   sms.setRemoteHost(" ******Some site given to us by open market people that opens on browser**********");
                   sms.setDebugMode(true);
                   sms.setRemotePort(8080);
                   sms.setSubscriberID(properties.getProperty("SMS.SubscriberID").trim());
                   sms.setSubscriberPassword(properties.getProperty("SMS.Password").trim());
                   // Message Settings
                   sms.setDestinationAddr(properties.getProperty("SMS.DestinationAddress").trim());          // recipient of message
                   sms.setSourceAddr(properties.getProperty("SMS.SourceAddress").trim());               // originator of message
                   sms.setMsgText("Hello World!");
                   System.out.println("Sending message to Simplewire...");
                   // submit message and check results
                   if (sms.submit())
                        System.out.println("Message was sent!");
         System.out.println("Ticket ID: " + sms.getMsgTicketID());
                   else
                        System.out.println("Message was not sent!");
                        System.out.println("Error Code: " + sms.getErrorCode());
                        System.out.println("Error Description: " + sms.getErrorDesc());
                        System.out.println("Error Resolution: " + sms.getErrorResolution() + "\n");
              } catch (IOException e)
              log.error("Load profile sms.properties failed to send Move.", e);
    I am using windows 7 and the required info from the java code is picked up from a property file.
    destination address is a "+" sign followed by cell number of client in US and I am in diff country.
    source code I am using is "+" sign followed by a short code given by client.
    I am also not aware what short codes are for.
    I am also not sure whether I am passing correct parameters.
    I just followed a demo code from the api's sample file. (open market api......swsms-2.9.16 is the jar used.).
    would like to know If destination address can be my cell number.
    The open market people have configured the demo short code for our SMS messaging account.
    This feature will allow us to test our platform to send and receive SMS messages
    while we are waiting for our dedicated short code.
    Mobile Originated messages MUST start with our assigned keyword(s) to be routed to you.
    We have a few keywords but don't know how to use them.
    Please help!
    Thanks in advance.
    Edited by: Vish_1x1 on Aug 24, 2010 11:06 PM

    I had a same problem.
    It was definately URL and SOAP Action Problem.
    Also, I didnt configure the Proxy too.
    Please dont waste more time in looking inot other configs.
    Just give a careful look at Target URL and SOAP Action, again and again.
    Sweta , Please make this question Answerd , it will be useful for other users.
    And Bahvesh Deserves good points..
    Thanks ,
    Deo.

  • Connection timed out: connect at com.sun.mail.imap.IMAPStore.protocolConne

    Hi ,
    Recently, my team need to work with javamail. Here I got a problem: when I run the application in my personal home network , it goes on very well. When I run the program in my company env, it gives error info:
    Exception in thread "main" javax.mail.MessagingException: Could not connect to SMTP host: smtp.gmail.com, port: 465;
    nested exception is:
    java.net.ConnectException: Connection timed out: connect
    at com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:1706)
    at com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:525)
    at javax.mail.Service.connect(Service.java:313)
    The resource is :
    import java.security.Security;
    import java.util.Date;
    import java.util.Properties;
    import javax.mail.Authenticator;
    import javax.mail.Message;
    import javax.mail.MessagingException;
    import javax.mail.PasswordAuthentication;
    import javax.mail.Session;
    import javax.mail.Transport;
    import javax.mail.internet.AddressException;
    import javax.mail.internet.InternetAddress;
    import javax.mail.internet.MimeMessage;
    *Use Gmail
    public class GmailSender {
    public static void main(String[] args) throws AddressException, MessagingException {
    Security.addProvider(new com.sun.net.ssl.internal.ssl.Provider());
    final String SSL_FACTORY = "javax.net.ssl.SSLSocketFactory";
    // Get a Properties object
    Properties props = System.getProperties();
    //Add proxy for GmailSender
    //especially here, I am not sure whether the proxy really works. In home network, it needn't proxy to run successfully.
    // props.setProperty("proxySet","true");
    // props.setProperty("socksProxyHost","148.87.19.20"); // This IP address is our proxy server address
    // props.setProperty("socksProxyPort","80");
    props.setProperty("mail.smtp.host", "smtp.gmail.com");
    props.setProperty("mail.smtp.socketFactory.class", SSL_FACTORY);
    props.setProperty("mail.smtp.socketFactory.fallback", "false");
    props.setProperty("mail.smtp.port", "465");
    props.setProperty("mail.smtp.socketFactory.port", "465");
    props.put("mail.smtp.auth", "true");
    final String username = "XXX";
    final String password = "XXX";
    Session session = Session.getDefaultInstance(props, new Authenticator(){
    protected PasswordAuthentication getPasswordAuthentication() {
    return new PasswordAuthentication(username, password);
    // -- Create a new message --
    Message msg = new MimeMessage(session);
    // -- Set the FROM and TO fields --
    msg.setFrom(new InternetAddress(username + "@gmail.com"));
    msg.setRecipients(Message.RecipientType.TO,
    InternetAddress.parse("[email protected]",false));
    msg.setSubject("Hello");
    msg.setText("How are you");
    msg.setSentDate(new Date());
    Transport.send(msg);
    System.out.println("Message sent.");
    Will you please help me to review my code and give me some suggestions ?

    No point looking at the code. The error message says the code can't connect to the server you are trying to connect to, so presumably there's a firewall or something like that preventing the connection. Talk to your network people.

  • RMI on Debian: Connection Timed Out: connect

    Hi
    I have a Problem with my RMI Server program running under Debian.
    When i start the server it lasts for about 3 minute until the Object is bound to the RMI-Registry.
    I have a simple System.out.println("XXX bound"); statement after binding the registry.rebind(name, stub);
    Well it seems to work because no exception is thrown and i can see the println.
    But the big problem is, that it takes for about 3 minutes until this is done. when i try to connect to the server via the client,
    i get a
    "Connection refused to host: xxxxx; nested exception is:
    java.netConnectException: Connection timed out: connect"
    after a minute, the serverside doesn't make anything, no System.out statement is executed in the remote method.
    it seems that RMI is very slow on my Server machine and i can't figure out why.
    here are the properties set in the server program:
    System.setProperty("java.rmi.server.codebase", "xxxxxx"); //works
         System.setProperty("java.rmi.server.hostname", "xxxx.ath.cx"); //perhaps the problem
         System.setProperty("java.security.policy", "/var/www/dod/xxxxx.policy"); // should be no problemmy client is startet via webstart from the same server an has the lookup code:
    try {
                   registry = LocateRegistry.getRegistry("xxxx.ath.cx"); //perhaps the problem
                   idodsrmi = (XXXServerRMI) registry.lookup("xxxxxxx");
                   usrh = idodsrmi.getUserHandle(args[0], args[1]);
              } catch (AccessException e) {
                   JOptionPane.showMessageDialog(null, e.getMessage());
                   e.printStackTrace();
              } catch (RemoteException e) {
                   JOptionPane.showMessageDialog(null, e.getMessage());
                   e.printStackTrace();
              } catch (NotBoundException e) {
                   JOptionPane.showMessageDialog(null, e.getMessage());
                   e.printStackTrace();
              } this code is executed without throwing an exception, but when i try to call methods on usrh i get the connection timeout...
    i can't see where the problem is, "xxxx.ath.cx" is the domain name my network is available from outside the lan,
    my router forwards port 80 and 1099 to my serverbox
    any ideas about the timeout?

    Yes that was it, i got the clou when i changed the hostname of my debian-box to xxx.ath.cx. after changing to that hostname i got an exception to google for.. ;-) But it's still strange to get no exception when the hostname of my debian-box differs from the dyndns name. it just lasts for about 3 minutes and seems to work...
    Well now im back to an older problem, my server uses hibernate to communicate with a db and when i make 2 .jars (1 hibernate-util with all hibernate related jars and 1 for my project) instead of 1 big jar with all jars i get the exception "No Persistence provider for EntityManager named DOD", thats a strange behavior too because the persistence.xml is at the same place in my project .jar... :-/

  • Connection timed out: connect

    Hi!
    i am trying to read a webpage into a string but i am getting error
    Exception in thread "main" java.net.ConnectException: Connection timed out: connectIs there any socket port related error.....ports below 1024 r blocked in our companies unix server.... if so please tell me the solution...
    Bunty
    Following is my code.
    import java.io.*;
    import java.net.URL;
    import java.awt.*;
    import java.net.*;
    public class urlTest {
                    public static void main(String args[]) throws Exception {
               try  { 
                         URL url = new URL ( "http://www.yahoo.com" ) ;
                      URLConnection urlConnection = url.openConnection (  ) ;
                      BufferedReader htmlPage = new BufferedReader ( new InputStreamReader ( url.openStream (  )  )  ) ;
                   String line = "";
                      while (  ( line = htmlPage.readLine (  )  )  != null )   { 
                                  //do something with the html line
                              htmlPage.close (  ) ;
                             urlConnection = null;
                        }  catch ( Exception e )   { 
                             e.printStackTrace (  ) ;
    }

    You most likely need to connect through a proxy server. Figure out the proxy host, port and used protocol (probably http) and then build your URL like this:
    URL url = new URL("http", "yourproxyhost",  80, "http://www.yahoo.com");Fill in the relevant information (80 is the proxy port in the above example, perhaps you need to fill in another port).
    Hope that solves your problem.

  • [C4003] Connection timed out: connect

    I have i problem when trying to connect to JMS resource through JMSConnection factory on a remote machine. I have standalone client with wich I can connect if a run it on the same machine that AppServer is running. When I try to connect from a remote machine I see SJSMQ JMS Resource Adapter starting... and than i get following error:
    com.sun.messaging.jmq.jmsclient.ExceptionHandler throwConnectionException
    WARNING: [C4003]: Error occurred on connection creation [machinename:7676]. - cause: java.net.ConnectException: Connection timed out: connect
    There are no errors in server log.
    I have set java options -Dorg.omg.CORBA.ORBInitialHost and -Dorg.omg.CORBA.ORBInitialPort when running standalone client.
    I've also created connectionFactory in appServer on client machine that points to remote machine and have succesfully connected to JMS that way.
    So why can't I connect directly to remote machine? Any suggestions?
    Thnx.
    Marko

    No point looking at the code. The error message says the code can't connect to the server you are trying to connect to, so presumably there's a firewall or something like that preventing the connection. Talk to your network people.

  • HttpUrlConnection: Connection timed out: connect

    I am seeing a small percentage of my customers who cannot connect to my server through my Java program to download program updates. The commonality between the customers is that all (or most) of them seem to be from Australia, but I have some customers in Australia who CAN connect successfully. Probably a red herring.
    The problem is seen when creating a URL connection to a text file to read it. The file contains only 3 lines. Like I said, most users do not have a problem, but some do. Could it be that the connection is actually timing out, and if so, how do I lengthen the timeout? Most users say that they do not even have to wait 5 seconds before the error occurs.
    The user can connect to the URL with a browser and download the files that way, but this is supposed to be an automatic process. They tell me there is nothing wrong with their network. I'm wondering whether they might have a firewall in place, but when I block connections using my software firewall, I get java.net.UnknownHostException instead.
    The code looks roughly like this. I've added printlns recently and have not heard back from the customer with any results.
            String urlString = cUpdateLocation + cUpdateFileName;
             try {
                System.out.println("Create the URL: " + urlString);
                URL url = new URL(urlString);
                System.out.println("Open the URL connection");
                URLConnection urlConn = url.openConnection();
               System.out.println("Get an input stream");
                InputStream inputStream = urlConn.getInputStream();
                System.out.println("Define an input stream reader");
               InputStreamReader iReader = new InputStreamReader(inputStream);
               System.out.println("Define a buffered reader");
                BufferedReader bReader = new BufferedReader(iReader);
               String input = "";
               System.out.println("Read from the buffered reader");
                try {
                    while (input != null) {
                       input = bReader.readLine();
                        if (input != null) {
                            // Ignore blank lines 
                          input.trim();
                            if (input.length() > 0) {
                                System.out.println("input=" + input);
                   System.out.println("Done reading from the buffered reader");
                    success = true;
                } catch (IOException e) {
                   // Catch these IOExceptions here so we can still close the
                    // streams and clean up while we have reference to them
    .                System.out.println("IOException encountered reading from:\n" +
                                      urlString + "\n" + e);
                bReader.close();
            } catch (MalformedURLException e) {
                System.out.println("URL " + urlString + " is malformed.  " +
                                   e.getMessage());
            } catch (IOException e) {
               // This is the exception that I normally see.
                System.out.println("IOException encountered creating stream to " +
                                   "read from:\n" + urlString + "\n" + e);
                e.printStackTrace();

    Did u write the code to handle Proxy server.?
    Though i m not sure but might be clients who are getting error uses proxy server. and other dont have a proxy in their network.
    Iu did not handled proxy u can do this by...
    Properties sysProperties = System.getProperties();
    // Specify proxy settings
    sysProperties.put("proxyHost", "your_proxy_host");
    sysProperties.put("proxyPort", "your_proxy_port");
    sysProperties.put("proxySet", "true");or while running
    use
    java -D option to set these system properties
    hope works
    cheers

  • Chat System: ConnectException: Connection timed out: connect

    Hi There,
    I am developing a chat system as part of a University project.
    To explain what I have implemented:
    I have three java classes;
    1. Chat Server class which is constantly listening for incoming socket connection on a particular socket:
    while (true)
    Socket client = server.accept ();
    System.out.println ("Accepted from " + client.getInetAddress ());
    ChatHandler c = new ChatHandler (client);
    c.start ();
    2. Chat Handler class uses a thread for each client to handle multiple clients:
    public ChatHandler (Socket s) throws IOException
    this.s = s;
    i = new DataInputStream (new BufferedInputStream (s.getInputStream ()));
    o = new DataOutputStream (new BufferedOutputStream (s.getOutputStream ()));
    public void run ()
    try
    handlers.addElement (this);
    while (true)
    String msg = i.readUTF ();
    broadcast (msg);
    catch (IOException ex)
    ex.printStackTrace ();
    finally
    handlers.removeElement (this);
    try
    s.close ();
    catch (IOException ex)
    ex.printStackTrace();
    protected static void broadcast (String message)
    synchronized (handlers)
    Enumeration e = handlers.elements ();
    while (e.hasMoreElements ())
    ChatHandler c = (ChatHandler) e.nextElement ();
    try
    synchronized (c.o)
    c.o.writeUTF (message);
    c.o.flush ();
    catch (IOException ex)
    c.stop ();
    3. Chat Client class which has a simple GUI and sends messages to the server to be broadcasted to all other clients on the same socket port:
    public ChatClient (String title, InputStream i, OutputStream o)
    super (title);
    this.i = new DataInputStream (new BufferedInputStream (i));
    this.o = new DataOutputStream (new BufferedOutputStream (o));
    setLayout (new BorderLayout ());
    add ("Center", output = new TextArea ());
    output.setEditable (false);
    add ("South", input = new TextField ());
    pack ();
    show ();
    input.requestFocus ();
    listener = new Thread (this);
    listener.start ();
    public void run ()
    try
    while (true)
    String line = i.readUTF ();
    output.appendText (line + "\n");
    catch (IOException ex)
    ex.printStackTrace ();
    finally
    listener = null;
    input.hide ();
    validate ();
    try
    o.close ();
    catch (IOException ex)
    ex.printStackTrace ();
    public boolean handleEvent (Event e)
    if ((e.target == input) && (e.id == Event.ACTION_EVENT)) {
    try {
    o.writeUTF ((String) e.arg);
    o.flush ();
    } catch (IOException ex) {
    ex.printStackTrace();
    listener.stop ();
    input.setText ("");
    return true;
    } else if ((e.target == this) && (e.id == Event.WINDOW_DESTROY)) {
    if (listener != null)
    listener.stop ();
    hide ();
    return true;
    return super.handleEvent (e);
    public static void main (String args[]) throws IOException
    Socket s = new Socket ("192.168.2.3",4449);
    new ChatClient ("Chat test", s.getInputStream (), s.getOutputStream ());
    On testing this simple app on my local host I have launched several instances of ChatClient and they interact perfectly between each other.
    Although when i test this app by launching ChatClient on another machine (using a wi-fi network connection at home), on the other machine that tries to connect to the hosting server (my machine) i get a "connection timed out" on the chatClient machine.
    I have added the port and ip addresses in concern to the exceptions to by-pass the firewall but i am still getting the timeout.
    Any suggestions?
    Thanks!

    Format your code with [ code ] tag pair.
    If you are a young university student I don't understand why current your code uses so many of
    too-too-too old APIs including deprecated ones.
    For example, DataInput/OutputStream should never be used for text I/Os because they aren't
    always reliable.
    Use Writers and Readers in modern Java programming
    Here's a simple and standard chat program example:
    (A few of obsolete APIs from your code remain here, but they are no problem.
    Tested both on localhost and a LAN.)
    /* ChatServer.java */
    import java.io.*;
    import java.util.*;
    import java.net.*;
    public class ChatServer{
      ServerSocket server;
      public ChatServer(){
        try{
          server = new ServerSocket(4449);
          while (true){
            Socket client = server.accept();
            System.out.println("Accepted from " + client.getInetAddress());
            ChatHandler c = new ChatHandler(client);
            c.start ();
        catch (IOException e){
          e.printStackTrace();
      public static void main(String[] args){
        new ChatServer();
    class ChatHandler extends Thread{
      static Vector<ChatHandler> handlers = new Vector<ChatHandler>();
      Socket s;
      BufferedReader i;
      PrintWriter o;
      public ChatHandler(Socket s) throws IOException{
        this.s = s;
        i = new BufferedReader(new InputStreamReader(s.getInputStream()));
        o = new PrintWriter
         (new BufferedWriter(new OutputStreamWriter(s.getOutputStream())));
      public void run(){
        try{
          handlers.addElement(this);
          while (true){
            String msg = i.readLine();
            broadcast(msg);
        catch (IOException ex){
          ex.printStackTrace();
        finally{
          handlers.removeElement(this);
          try{
            s.close();
          catch (IOException e){
            e.printStackTrace();
      protected static void broadcast(String message){
        synchronized (handlers){
          Enumeration e = handlers.elements();
          while (e.hasMoreElements()){
            ChatHandler c = (ChatHandler)(e.nextElement());
            synchronized (c.o){
              c.o.println(message);
              c.o.flush();
    /* ChatClient.java */
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    import java.net.*;
    import java.io.*;
    public class ChatClient extends JFrame implements Runnable{
      Socket socket;
      JTextArea output;
      JTextField input;
      BufferedReader i;
      PrintWriter o;
      Thread listener;
      JButton endButton;
      public ChatClient (String title, Socket s){
        super(title);
        setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        socket = s;
        try{
          i = new BufferedReader(new InputStreamReader(s.getInputStream()));
          o = new PrintWriter
           (new BufferedWriter(new OutputStreamWriter(s.getOutputStream())));
        catch (IOException ie){
          ie.printStackTrace();
        Container con = getContentPane();
        con.add (output = new JTextArea(), BorderLayout.CENTER);
        output.setEditable(false);
        con.add(input = new JTextField(), BorderLayout.SOUTH);
        con.add(endButton = new JButton("END"), BorderLayout.NORTH);
        input.addActionListener(new ActionListener(){
          public void actionPerformed(ActionEvent ae){
            o.println(input.getText());
            o.flush();
            input.setText("");
        endButton.addActionListener(new ActionListener(){
          public void actionPerformed(ActionEvent ev){
            try{
              socket.close();
            catch (IOException ie){
              ie.printStackTrace();
            System.exit(0);
        setBounds(50, 50, 500, 500);
        setVisible(true);
        input.requestFocusInWindow();
        listener = new Thread(this);
        listener.start();
      public void run(){
        try{
          while (true){
            String line = i.readLine();
            output.append(line + "\n");
        catch (IOException ex){
          ex.printStackTrace();
        finally{
          o.close();
      public static void main (String args[]) throws IOException{
        Socket sock = null;
        String addr = "127.0.0.1";
        if (args.length > 0){
          addr = args[0];
        sock = new Socket(addr, 4449);
        new ChatClient("Chat Client", sock);
    }

  • Timed Out Connection

    I have a Linksys E1200 and suddenly I can't seem to connect using the router. The Timed Out error sign comes up on my Mac. I have version 10.7.5 And nothing has changed on my computer. It's not my internet because I can connect using the cable, I have tried to reset the router, and the computer, several times, and it doesn't seem to be working. My phone won't even connect. Is there anything else I can do? Thanks in advance!

    Ok, possible other WiFi neighbors in your area could be causing interferences. Linksys will have someone on the phoen to help you out. Ask them to check for interferences and changing channels to 1, 6 or 11. 13 if your not in the USA region. 
    Good Luck.

  • Connection timed out: connect for ebMs messages

    Hi
    We are facing a problem while posting an outbound message in ebMS. We encounter the following error.
    Machine Info: (INBAAMPC00933)
    *Transport error: [IPT_HttpSendConnectionRefused] HTTP connection is refused.*
    Connection refused: connect
    Oracle b2b is used at both the ends. The initiating b2b does not have any certificates, while the receiving b2b has a certificate and 2 Delvery Channels (DCs). One of the DC's does not use certificates and that is the one tied to the agreement. So, Iam assuming this error is not due to the certificates. Could you please help me out in this.
    Ranjith

    Hi Ranjith,
    It seems that receiving B2B or any other front end(like any switch) is expecting the initiating B2B to send message over HTTPS.
    Please check whether you are able to ping and telnet the receiving B2B's host name at the port specified in the initiating B2B configuration. Also make sure that this port has HTTP enabled and not HTTPs.
    Let us know the result.
    Regards,
    Anuj

  • I have been unable to update my Iphone 4S software to V5.1 - same message - operation timed out - connection interruption.  From various PC's and Laptops!

    I have been struggeling for days to update my Iphone software to V5.1.  On my desktop PC with uninterrupted ADSL I received a message "error in connection" and operation tmed out"  I have used my laptop (with no previous Itunes programs) installed Itunes and connected my Iphone 4S.  I constantly receive the same message?

    if you have ios 5.0 on your device you can update it directly from the iphone.
    go to settings / softwareupdate.
    do a backup on your iphone first.

  • Connection timed out, Connection timed out

    I get this message whenever I try to get reconnected to known wireless networks, please help.

    i was updating my iphone and it just stopped, now says i have to restore to have phone load, it also just has a plug and the end of a usb showing on face of phone i also will loose all data pics, music if i restore what can i do to get it to connect and upload data to computer/itunes HELP

  • My iphone wont update keeps saying timed out connection

    software downloads then this message is displayed i have iphone 4 and trying to download 4.3.3 any ideas????

    Disable ALL security apps (firewall, antivirus/spyware, etc.) running on your computer.
    Another idea is to use the forum search box before posting.  This question has been asked and answered TNTC here.

Maybe you are looking for

  • Half a chime (cuts off), no video, no boot

    My G5 just crashed launching a Protools session. It will no longer boot. It chimes - but the chime sound is cut off half way. The fans power up and I can hear the drives spin up. I've removed PCI cards, swapped drives, swapped RAM... nothing helps. N

  • How do I send fax

    How Can I send Fax with my power mac G4 OS 10.4.11, I had Adobe acrobat pro 7.0 Installed but when I use print there are no option for send fax to chose.

  • Enhancement in ESS Leave Request

    Hi Gurus, I am new to webdynpro Java. I have a requirement to add a custom button in a Standard ESS leave request (Webdynpro Java) view. When i click the the button it has to call popview(not sure is it possible to call a webdynpro abap view).  If po

  • How to access my icloud videos

    I need to access videos from my icloud and cant find it.

  • Tethered shooting with a Nikon D200..

    I have a D200 and want to shoot macro images in the field and check images especially depth of field on my MacBook (Intel). Is it correct that with Aperture 2.0 no other Nikon software is required for tethered shooting? Thanks for any help and/or web