Flash client not cleaning up socket connections

I have an embedded flex application which recieves asyncronous data updates from a Blaze DS server on Tomcat that is using spring integration. I'm currently using a single, unsecure channel just to make things simple.
My problem is that I'm periodically getting faults on the connection. This is happening far too often and it takes a considerable amount of time for it to succesfully reconnect. In investigating I've set up TCPMon to monitor the communications between the flex client and tomcat.
When my application initially starts I see an active AMF connection with my server and my client recieves messages normally. However, if I exit the screen, tcpmon shows that the connection is still active. It times out and closes the connection within a minute or so. Restarting the application by returning to the page opens a new connection normally.
The problem is that when I hit the refresh button on the page -- I.E. 7 -- the old connection doesn't go away, but the flex client attempts to create a new connection. Via TCPMon I see these requests and the server responds with the error:
    The request sent by the client was syntactically incorrect ().
This is error 400 from tomcat but with no detail. The flex client will attempt to reconnect several times in vain and eventually it will call my fault handler. Throughout the reconnect process, TCPMon shows the original connection still open. It eventually times out as described above and the application sits idle with no connection to the server. If I refresh again after the "leaked" connection has closed the application connects successfully.
Examining the failed requests vs. the successful requests I find that they are all using the same JSESSIONID which makes sense because the browser has not exited, just the flash player. I'm assuming that the server is giving a response of 400 because I'm trying to create a second connection with the same session ID. However, I have not been able to verify this.
Obviously, it would be nice if the server responded with some more detail on the rejected requests. However, it seems to me that the flash player ought to close it's sockets instead of leaving the wire-protocol to time out. On the server side, I have turned on trace logging and I see the request being processed, but I don't see any indication that the request fails. (errors, warnings, etc.) I have tried to close the socket from the client side using Consumer.unsubscribe(), Consumer.disconnect(), and ChannelSet.disconnectAll() to no avail. The socket remains open until the TCP timeout. I have walked through the ChannelSet.disconnectAll() logic on the client side, but it is extremely complex and I have not found any code that closes a socket.
Has anyone else seen this behavior? Does anyone know of any workarounds for it? I hate to spend the time walking through code if someone has already found a solution.

This is clearly a problem with the StreamingAMFChannel in the I.E. flash player. Under firefox all this stuff works.
Apparently, it is taking a very long time for StreamingAMFChannel to initialize for some reason. The NetConnectionChannel is relying on the connected boolean to determine whether or not it should disconnect it's socket when it's told to disconnect. That's a bad idea. Until the streaming protocol has completed initialization it's not connected even though the NetConnectionChannel's socket is connected. The NetConnectionChannel should look at it's socket rather than relying on the Stream state.
The question now is why it takes so long to initialize but only with I.E.

Similar Messages

  • Server does not get a socket connect event with Apache MINA

    I have this weird problem that was recently detected.
    I have a server written with the Apache MINA framework that runs a Linux machine with 64 bit server JVM 6.0.
    The server accept sockets from clients using our own proprietary protocol, and everything works ok for some time.
    After a couple of hours, the server seems to stop getting the socket accept events (in MINA, the sessionOpened event) and the socket close event.
    It seems that we can open a socket to the JVM, but the application does not know about it.
    Does anyone got something like this with MINA or NIO?
    Any idea?
    Thanks
    Ran.

    Ok fixed. 
    At a elevated cmd prompt run ;
    C:\Users\administrator.TOM>setspn -x
    As you can see the DC serv1 had duplicate SPNs.
    Checking domain DC=TOM
    Processing entry 1
    HOST/serv1.TOM is registered on these accounts:
            CN=SERV1,OU=Domain Controllers,DC=TOM
            CN=C00049,CN=Computers,DC=TOM
    {14E52635-0A95-4a5c-BDB1-E0D0C703B6C8}/TOWN-HBWJ29ZOQC is registered on these ac
    counts:
            CN=Administrator,CN=Users,DC=TOM
            CN=TOWN-HBWJ29ZOQC,CN=Computers,DC=TOM
    {14E52635-0A95-4a5c-BDB1-E0D0C703B6C8}/town-hbwj29zoqc.TOM is registered on thes
    e accounts:
            CN=Administrator,CN=Users,DC=TOM
            CN=TOWN-HBWJ29ZOQC,CN=Computers,DC=TOM
    RestrictedKrbHost/serv1 is registered on these accounts:
            CN=C00049,CN=Computers,DC=TOM
            CN=SERV1,OU=Domain Controllers,DC=TOM
    RestrictedKrbHost/serv1.TOM is registered on these accounts:
            CN=C00049,CN=Computers,DC=TOM
            CN=SERV1,OU=Domain Controllers,DC=TOM
    found 5 groups of duplicate SPNs.
    Went to the computers OU and changed computer c00049 to the correct SPN. Now I have a new issues, I'll start a new thread.

  • Adobe Flash Player not working in Adobe Connect only on Tablet PC

    When logging into Adobe Acrobat Connect Pro on a Tablet PC, the following message is observed.
    Flash Player 9.0.0.0 or above is required
    Adobe Acrobat Connect Pro requires the Flash Player browser plugin, version 9.0.0.0 or above. Please download and install the Flash Player to continue.
    Download Flash Player
    Refresh Homepage
    Adobe Flash player 10.0.45.2 is installed on the Tablet, when we check the adobe flash player version from http://kb2.adobe.com/cps/155/tn_15507.html it shows the correct version (10.0.45.2)
    Tablet PC has Windows XP SP2 OS.
    Any Suggestion on this issue?
    Please let me know if more information is required.

    Upgrade of office 2007 had caused this issue.  Office 2007 Infopath had broken the functionality on tablet pc. 
    Solution: Delete register key under
    [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Internet Settings\5.0\User Agent\Post Platform]
    "InfoPath.2"=""

  • Multiple clients on socket connection

    Hi!
    I understand that it is possible that multiple clients listen to one server (on the same port) and even write to it (then it should be a multi-threaded server).
    But i would like to refuse connectios, if one client is connected. How can I do that?
    In my case I have a (single threaded) server. Now one clients connects. The server waits to receive data from the client and answers, without ever closing the port. that works.
    Now if I connect with a second client, the openicng of the socket in the second client works fine, although the server does not seem to notice the second client. Communication is not possible between the server and the second client, and the server doesn't answer to the first client anymore, although he receives data from it.
    So, since the server does not seem to notice the second client (does not accept the connection) and I don't get an exception at the second client, what can I do?
    Thank you for your help!
    concerned Code (if you want to take a look at it):
    CLIENT:
    socket = new Socket(hostname, echo_port);
    SERVER:
    try
    ServerSocket waitingsocket = new ServerSocket(echo_port);
    try
         socket= waitingsocket.accept();
         System.out.println("Client connected");
         ReaderThread reader = new ReaderThread( this, socket );
         reader.start();          
    catch (Exception e)
    READER:
    public void run()
         while (true)
              try {
                   int bytesRead = inStream.read(inputBuffer,
                   0, inputBuffer.length);
                   readCallback.tcpUpdate(inputBuffer,bytesRead);
              catch (Exception oops)
                   readCallback.tcpUpdate(null,-1);
              

    Just to make sure this is clear: You can NOT have multiple clients on a given socket connection. You CAN have multiple clients connected to a particular port on a given server, but each client will be communicating with the server through a different of socket.
    The usual approach here is to set up a listening ServerSocket on the desired port, call accept() on it, then process the communication from the returned Socket object. This is usually done by spawning a new thread and allowing it to handle the socket communication, while the ServerSocket loops around to another accept() for the next communication.
    Here's an excellent intro to the concepts (the code is really ugly and poorly implemented, but it does a good job of explaining the overall concept). I used this as a starting point, and now (after a whole lot of development) have a pretty sweet extensible web server class that handles template expansion, etc... (I use this as a quick and dirty UI for some of my apps, instead of requiring the user to install a JSP container):
    http://developer.java.sun.com/developer/technicalArticles/Networking/Webserver/
    - K

  • Connect Flash to Serial Port with Local Socket Connection

    Hey all,
    So, I am trying to connect a Flash movie to a serial port
    and have it react to the input coming in. Of course, Flash does not
    have this capability built in, so I need a workaround. I also
    program in Director, and there are easier ways to deal with this
    there, but since there hasn't been an update in years, and for
    other technical reasons, I would like to use a pure Flash program.
    I also need to take advantage of some of the new hardware
    acceleration improvements and horizontal sync issues that come with
    running the Flash player full screen. So, there are some tools out
    there that will let me stream the input from the serial port to a
    web address. I figure I could use the local address and assign a
    port number, then use Flash to create a local socket connection. I
    am having issues opening ports on my computer, and a few other
    things, but in theory, I think it should work. I know that I won't
    get all the answers here, but if anyone has done anything of the
    sort, or might know of some similar projects, it would really help.
    I am more of a Director/Flash programmer, and not so much one on
    the system level. So, opening local sockets, etc, while I am sure I
    can figure it out, is still a bit beyond me. Thanks all!
    - Bruce

    You may want to look into flash remoting, which would allow
    you to push content to the flash movie. You could then write a
    proxy between the source of your stream and flash the remoting
    server.

  • Sockets connection

    Can anybody help me how to connect Flash to a server Using Sockets connection using in AS3.

    Use following code UPDATED:
    try
    var mySocket:Socket = new Socket();
    var isConnected:Boolean = false;
    var portNumber:Number =8000; //Enter Port number you want to use instead of 8000;
    var IPAddress:String = "localhost"; //Enter server IP instead of localhost;
    //Valid range of port numbers is 1 to 65535
    if (portNumber >= 1 && portNumber <= 65535)
      //Create new socket.
      mySocket=new Socket  ;
      //Connect to host and port.
      mySocket.connect(IPAddress,portNumber);
      //Add listeners to socket to start communicating with the server.
      mySocket.addEventListener(IOErrorEvent.IO_ERROR,errorOccured);
      mySocket.addEventListener(SecurityErrorEvent.SECURITY_ERROR,errorOccured);
      mySocket.addEventListener(ProgressEvent.SOCKET_DATA,readFromServer);
      mySocket.addEventListener(Event.CONNECT,connectionEstablished);
    else
      //Show error message
      trace("Server is not reachable on port " + portNumber + ".");
      ExternalInterface.call("alert","Server is not reachable on port " + portNumber + ".");
    catch (e)
    //Show error message
    trace("Server is not reachable.");
    ExternalInterface.call("alert","Server is not reachable.");
    function readFromServer(evnt:ProgressEvent):void
    //Read message
    var str:String = mySocket.readUTFBytes(mySocket.bytesAvailable);
    //Remove line breaks.
    while (str.indexOf("\n") > -1)
      str = str.replace("\n","");
    while (str.indexOf("\r") > -1)
      str = str.replace("\r","");
    //Message from server received...
    trace(str);
    function writeToServer(toUserName:String, messageStr:String):void
    if (isConnected)
      var pushStr = "Message from Flash to server";
      mySocket.writeUTFBytes(pushStr);
      mySocket.flush();
    //This function is called when connection to server is successful.
    function connectionEstablished(evnt:Event)
    //Mark socket connection with the server as connected.
    isConnected = true;
    function errorOccured(evnt:Event)
    //Some error occured
    trace("Some error occured!");
    ExternalInterface.call("alert","Some error occured!");

  • Help in keeping a Persistent Socket connection

    Hello All,
    Pardon me, this is a silly question.. I have a Client who is using socket connection to connect to a server.. Currently the client is not maintaining a persistent connection. IT connects to t he server ,sends & receives messages from the server and then closes the connection. How do I keep the Socket connection alive so I can get the messages sent from the server asynchronously ???
    thanks for your time

    Thanks for your reply. Can I use thread to keep the connection alive.??? If so , It would be really helpful if U can show me a sample code......
    Below is my piece of code...
    try{
    socket_Client = new Socket(name_server,portNumber);
    InputStream input = socket_Client.getInputStream();
    InputStreamReader in2 = new InputStreamReader(input);
    BufferedReader in = new BufferedReader(in2);
    getMessages(in); //this method gets the messages from the server
    } catch ( Exception e)
    } finally {
    socket_Client.close()
    thanks again

  • Problem: Socket connection is not creating in machine, through utility program (MFC Dll), on ListDisplay service port - 3334 (on separate machine), while we are able to telnet on same ListDisplay service port - 3334 from same issue machine on same time

    Problem: Socket
    connection is not creating in machine, through utility program (MFC Dll), on ListDisplay service port - 3334 (on separate machine), while we are able to telnet on same ListDisplay service port - 3334 from same issue machine on same time
    Environment: -
    OS:
    Windows XP SP2/7
    Code:
    VC 6.0
    Dll: MFC
    Problem Description: -
    We have written a utility program which create socket (Using windows standard method [MFC]), and then make connection with another service (List Display) running
    on port 3334 in different machine and retrieve the required list data. This program was working fine in almost all the machines.
    But, we have received a severe intermittent issue on two machines. Client is facing issue in displaying the list data from port 3334.
    Attempt: -
    First we tried to debug code, and we come to know that socket is not creating in utility program. So we tried to telnet on ListDisplay service port 3334 and we were surprised that we were able to telnet, then we opened some more
    telnet window on same port 3334 around (6 to 8) window, and each cmd connected properly. But we were not able to create socket from utility program.
    Problem is severe because issue is intermittent.
    We have tried all the way, but we are not able to figure it out, that what can be the exact problem and what are the conditions, when utility program will not
    connect with ListDisplay service on port 3334.
    Kindly assist to resolve this issue. For any help, we would be really thankful.

    Hi,
    According to your description, it seems that you have created an utility program which is making connection with another service port 3334, however, two clients are facing issue in display the data list from port 3334.
    Port: 3334/TCP
    3334/TCP - Known port assignments (1 record found)
    Service
    Details
    Source
    directv-web
    Direct TV Webcasting
    IANA
    Since the port 3334 is used by directv-web service, I'd like to suggest check this service it is working well on the problematic clients.
    1. The client can be resolved in DNS well? Please run "nslookup" in the prompt command.
    2. Is there any 3rd party application interrupting? Do test in clean boot.
    2. Strongly suggest you run process monitor tool to analysis it.
    I am looking forward to your reply if you have any updated on your side.
    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.

  • Clean Access Server could not establish a secure connection

    I have a OOB Real IP GW setup on v4.1.2
    I seem to have a problem with the CAS connecting to the CAM although I have added the CAS to the CAM and can manage the CAS from the CAM.
    I noticed while troubleshooting client authentication that the client was not being redirected to the logon web page and it had full access to the trusted network from the untrusted authentication vlan. I eventually figured out that if I change the CAS Filter Fallback method from Allow to ignore then it tries to authenticate the client. However the fact that the fallback is activated tells you that something is not right.
    I have 2 problems:
    A) The clients web page is redirected for authentication but it only lists the domain name in the URL and not the hostname or host IP. In the lab I do not have a DNS server and it would not help as it does not include the hostname in the URL anyway. How do I fix this or perhaps it's related to the 2nd problem.
    B) When I manually change the URL by replacing the domain name with the IP of the CAS (untrusted OOB Real IP GW) then I get the following error message when logging on:
    Network Error:
    Clean Access Server could not establish a secure connection to Clean Access Manager at mydomain.com.
    This could be due to one or more of the following reasons: 1) Clean Access Manager certificate has expired 2) Clean Access Manager certificate cannot be trusted or 3) Clean Access Manager cannot be reached.
    Please report this to your network administrator.
    I would guess the culprit is No 2 but surely the system can run on self signed certificates? I have an NTP server so time is in sync. I have even tried regenerating the cetificates on the CAM
    & CAS.
    Any ideas?

    To overcome problem B, I regenerated the SSL Certificates using the host IP address instead of the name for all the CAM & CAS appliances. This seems to have resolved this problem.
    I also SSH'd from each of the CAS's to each of the CAM's from the CLI and it then prompts to permanently store the certificates. I'm not sure it this was necessary though.

  • My simple chat server does not send messages to connected clients

    Hi!
    I´m developing a chat server. But I can not get it work. My client seems to make a connection to it, but my server does not send the welcome message it is supposed to send when a client connects. Why not?
    removedEdited by: Roxxor on Nov 24, 2008 10:36 AM

    Ok, I solved my previous problem and now I have got a new really annoying one.
    This is a broadcasting server which meand it can handle multiple clients and when one client sends a message to the server, the server should broadcast the message to all connected clients. It almost works, except that the server just sends the message back to the last connected client. The last connected client seems to steal the PrintStream() from the other clients. How can I solve that?
    import java.io.*;
    import javax.microedition.io.*;
    import javax.microedition.midlet.*;
    import javax.microedition.lcdui.*;
    import java.lang.Character;
    import java.io.OutputStream;
    import java.util.Vector;
    public class ChatServer extends MIDlet implements CommandListener, Runnable
         private Display disp;
         private Vector connection = new Vector();          
         private TextField tf_port = new TextField("Port: ", "", 32, 2);               
         private Form textForm = new Form("Messages");
         private Form start_serverForm = new Form("Start server", new Item[] {  tf_port });
         private Command mExit = new Command("Exit", Command.EXIT, 0);
         private Command mStart = new Command("Start", Command.SCREEN, 0);
         private Command mDisconnect = new Command("Halt server", Command.EXIT, 0);
         ServerSocketConnection ssc;
         SocketConnection sc;
         PrintStream out;
         public ChatServer()
              start_serverForm.addCommand(mExit);
              start_serverForm.addCommand(mStart);
              start_serverForm.setCommandListener(this);
              tf_port.setMaxSize(5);
              textForm.addCommand(mDisconnect);
              textForm.setCommandListener(this);
         public void startApp()
              disp = Display.getDisplay(this);
              disp.setCurrent(start_serverForm);
         public void pauseApp()
         public void destroyApp(boolean unconditional)
         public void commandAction(Command c, Displayable s)
              if(c == mExit)
                   destroyApp(false);
                   notifyDestroyed();
              else if(c == mStart)
                   Thread tr = new Thread(this);
                   tr.start();
              else if(c == mDisconnect)
                   try
                        sc.close();                              
                   catch(IOException err) { System.out.println("IOException error: " + err.getMessage()); }
                   destroyApp(false);
                   notifyDestroyed();
         public void run()
              try
                   disp.setCurrent(textForm);
                   ssc = (ServerSocketConnection)Connector.open("socket://:2000");
                   while(true)               
                        sc = (SocketConnection) ssc.acceptAndOpen();     
                        connection.addElement(sc);                                                  
                        out = new PrintStream(sc.openOutputStream());
                        textForm.append(sc.getAddress() + " has connected\n");
                        ServerToClient stc = new ServerToClient(sc);
                        stc.start();
              catch(IOException err) { System.out.println("IOException error: " + err.getMessage()); }
              catch(NullPointerException err) { System.out.println("NullPointerException error: " + err.getMessage()); }
         class ServerToClient extends Thread
              String message;
              InputStream in;
              SocketConnection sc;
              ServerToClient(SocketConnection sc)
                   this.sc = sc;
              public void run()
                   try
                        in = sc.openInputStream();
                        int ch;
                        while((ch = in.read())!= -1)                         
                             System.out.print((char)ch);
                             char cha = (char)ch;                              
                             String str = String.valueOf(cha);                    
                             out.print(str);
                             //broadcast(str);
                             textForm.append(str);                              
                        in.close();
                        //out.close();
                           sc.close();
                   catch(IOException err) { System.out.println("IOException error: " + err.getMessage()); }
    }

  • Socket Question: Client not receiving the server messages...

    I have a client and server where in the client sends the server a file name to look for. The server looks for that file and checks for its existence and reads the file line by line displays it and then sends it to client. The client should recieve the contents send by the server and display it line by line. Here is what I have done
    Server
    import java.io.*;
    import java.net.*;
    import java.awt.*;
    import javax.swing.*;
    public class Server extends JFrame
         public static void main( String args[] )
    //Pass the port no as an argument
    Server s = new Server(Integer.parseInt(args[0]));
    s.runServer();
         private ServerSocket ss;
         private Socket Connection;
         private BufferedReader input;
         private BufferedWriter output;
         private PrintWriter poutput;
         private int port;
         private int bufLength;
         private JTextArea display;
         public Server(int port)
              super( "Socket Server" );
              display = new JTextArea();
              getContentPane().add( display, BorderLayout.CENTER );
              setSize( 400, 300 );
              setVisible( true );
    // Construct of a socket
              try
                   ss = new ServerSocket(port);
              catch( SocketException se )
                   se.printStackTrace();
                   System.exit( 1 );
              catch( IOException io )
                   io.printStackTrace();
         public void runServer()
              String fileName = null;
              try
                   Connection = ss.accept();
                   input = new BufferedReader(new InputStreamReader(Connection.getInputStream()));
                   OutputStreamWriter out = new OutputStreamWriter(Connection.getOutputStream());
                   boolean done = false;
                   while(!done)
                        String lline = input.readLine();
                        if (lline != null)
                             done = true;
                             display.append( "\nThe server has read the file name:" + lline);
                             fileName = lline.trim();
                   input.close();
                   File fileLoc = new File(fileName);
                   if (fileLoc.exists())
                        input = new BufferedReader(new FileReader(fileLoc));
                        boolean eof = false;
                        while (!eof)
                             String line = input.readLine();
                             if (line == null)
                                  eof = true;
                             else
                                  display.append( "\nThe server has read the line:" + line);
                                  out.write(line);
                             Connection.close();
                   else
                        String message = "The file specified does not exist on this server. Recheck your request";
                        poutput.println(message);
                   out.flush();
              catch (Exception e)
                   System.out.println(e);
    Client
    import java.io.*;
    import java.net.*;
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    public class Client extends JFrame implements ActionListener
    private JTextField enter;
    private JTextArea display;
    private BufferedReader bufferInput;
    private BufferedWriter bufferOutput;
    private Socket connection;
    private JPanel p;
    private JLabel label;
    private PrintWriter out;
    private int serverPort;
    private int bufLength;
    public Client(int serverPort)
    super( "Client Socket" );
    label = new JLabel("Enter file name to retrieve:");
    enter = new JTextField();
    enter.addActionListener( this );
    getContentPane().add( enter, BorderLayout.NORTH );
    display = new JTextArea();
    getContentPane().add( display, BorderLayout.CENTER );
    setSize( 400, 300 );
    setVisible( true );
         String serverHost = "spentapa-nt";
    try
    connection = new Socket(serverHost, serverPort);
    //Input stream
    bufferInput = new BufferedReader(new InputStreamReader(connection.getInputStream()));
    //Output Stream
         out = new PrintWriter(connection.getOutputStream(),true);
    catch( SocketException se )
    se.getMessage();
    se.printStackTrace();
    System.exit( 1 );
    catch( IOException io )
              io.printStackTrace();
    public void actionPerformed( ActionEvent e )
         String fileName = null;
    try
              Object o = e.getSource();
              if(o==enter)
                   fileName = enter.getText();
                   System.out.println("The file entered is :"+ fileName);
              out.println(fileName);
    display.append( "\nThe File is:" + "\n" );
    //sends the text file to the server
    //receives the contents of the text file from the server
    boolean eof = false;
    boolean eof = false;
         while (eof)
              String line = bufferInput.readLine();
              if (line == null)
                   eof = true;
              else
                   display.append( "\n" + line);
              System.out.println(line);
         out.flush();
    catch ( Exception ioe )
    display.append(ioe.getMessage() + "\n" );
    ioe.printStackTrace();
    public static void main( String args[] )
    //Pass the Host Name and Port no. as arguments
    Client c = new Client(Integer.parseInt(args[0]));

    For starters, change while(eof) to while(!eof)

  • Java Chat (Server, Client Socket Connection)

    Assignment:
    The assignment is to deliver two source codes that can run a Server (1) and Clients (2) in order to create a simpel chat program. The server has to wait and check an IP (localhost) + Port, and the client has to connect to that port and create a socket connection. The only thing that should be done is create a new socket connection for each client... and when a client sends a message, the message should be delivered to all clients connected to the server.
    Problem...
    However I can read an edit Java, it's difficult for me to write it. I allready found many turturials about socket connections on the internet, and tried to edit those, but they don't really do what I want unless I really write new shit. Is there a way you guys can help me with this, or that you find a really good website that fits my question?

    According to me ,
    take string variable 'str'
    Take some class ,I think u already taken.....
    Scoket scoket = new Socket(IP,port);
    OutputStream out;
    IInputStream in;
    in = socket.getInputStream();
    out = socket.getOutputStream();
    If sends the msg then use
    out.writeObject(str);
    This line sends data to the other user
    msg resivce from client then use
    str = in.readInput();
    & this str set to the any objects out put .
    Such as TextField.setText(str);
    //Server.class
    import java.io.EOFException;
    import java.io.IOException;
    import java.io.ObjectInputStream;
    import java.io.ObjectOutputStream;
    import java.net.ServerSocket;
    import java.net.Socket;
    import java.awt.*;
    import java.awt.event.*;
    import java.awt.event.ActionListener;
    import javax.swing.*;
    public class Server extends JFrame
              private JTextField enterdField;
              private JTextArea displayArea;
              private ObjectOutputStream output;
              private ObjectInputStream input;
              private ServerSocket server;
              private Socket connection;
              private int counter=1;
              public Server()
                        super("Server");
                        enterdField = new JTextField();
                        enterdField.setEditable(false);
                        enterdField.addActionListener(
                             new ActionListener()
                                       public void actionPerformed(ActionEvent event)
                                                 sendData(event.getActionCommand());
                                                 //System.out.println(event.getActionCommand());
                                                 enterdField.setText("");
                   add(enterdField,BorderLayout.NORTH);
                   displayArea = new JTextArea();
                   add(new JScrollPane(displayArea),BorderLayout.CENTER);
                   setSize(300,150);
                   setVisible(true);
              public void runServer()
                        try
                                  server = new ServerSocket(12345,100);
                                  while(true)
                                            try
                                                      waitForConnection();
                                                      getStreams();
                                                      processConnection();
                                            catch(EOFException eofexception)
                                                      displayMessage("\nServer terminated connection");
                                            finally
                                                      closeConnection();
                                                      counter++;
                        catch(IOException ioException)
                                  ioException.printStackTrace();
              private void waitForConnection() throws IOException
                        displayMessage("Waiting for connection");
                        connection = server.accept();
                        //System.out.println(server.accept());
                        System.out.println(connection.getInetAddress());//Server Address and Hostname.
                        displayMessage("Connection"+counter +"received from :"+connection.getInetAddress().getHostName());
              private void getStreams() throws IOException
                        System.out.println("Start getStream");
                        output = new ObjectOutputStream(connection.getOutputStream());
                        output.flush();
                        input = new ObjectInputStream(connection.getInputStream());
                        displayMessage("\nGot I/O stream\n");
              private void processConnection() throws IOException //Read data from Client for Server.
                        String message="Connection sucessful To Client";
                        sendData(message);
                        int i=0;
                        setTextFieldEditable(true);
                        do
                                  try
                                            message =(String) input.readObject();//For Client
                                            System.out.println("Input from :"+message);//From Client
                                            displayMessage("\n" + message);
                                            System.out.println("\n" + i++);
                                  catch(ClassNotFoundException classnotfoundexception)
                                            displayMessage("\nUnknown object type recived");
                        while(!message.equals("CLIENT>>>TERMINATE"));
              private void closeConnection()
                        displayMessage("\nTeminating connection");
                        setTextFieldEditable(false);
                        try
                                  output.close();
                                  input.close();
                                  connection.close();
                        catch(IOException ioException)
                                  ioException.printStackTrace();
              private void sendData(String message)//Write data to the Client from the Server.
                        try
                                  output.writeObject("SERVER>>>"+message);//For Client side.
                                  System.out.println(message);
                                  output.flush();
                                  displayMessage("\nSERVER>>>"+message);//On server side.
                        catch(IOException ioException)
                                  displayMessage("\nError writing object");
              private void displayMessage(final String messageToDisplay)
                        SwingUtilities.invokeLater(
                             new Runnable()
                                  public void run()
                                            displayArea.append(messageToDisplay);
              private void setTextFieldEditable(final boolean editable)
                        SwingUtilities.invokeLater(
                             new Runnable()
                                  public void run()
                                            enterdField.setEditable(editable);
              public static void main(String q[])
                        Server app = new Server();
                        app.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
                        app.runServer();
    //Client.class
    import java.io.EOFException;
    import java.io.IOException;
    import java.io.ObjectInputStream;
    import java.io.ObjectOutputStream;
    import java.net.InetAddress;
    import java.net.Socket;
    import java.awt.*;
    import java.awt.event.*;
    import java.awt.event.ActionListener;
    import javax.swing.*;
    public class Client extends JFrame
         private JTextField enterField;
         private JTextArea displayArea;
         private ObjectOutputStream output;
         private ObjectInputStream input;
         private String message="";
         private String chatServer;
         private Socket client;
         public Client (String host)
                   super("Client");
                   chatServer=host;
                   enterField = new JTextField();
                   enterField.setEditable(false);
                   enterField.addActionListener(
                        new ActionListener()
                                  public void actionPerformed(ActionEvent event)
                                            sendData(event.getActionCommand());
                                            enterField.setText("");
                        add(enterField,BorderLayout.NORTH);
                        displayArea = new JTextArea();
                        add(new JScrollPane(displayArea),BorderLayout.CENTER);
                        setSize(300,150);
                        setVisible(true);
         public void runclient()
                   try
                             connectToServer();
                             getStreams();
                             processConnection();
                   catch(EOFException eofException)
                             displayMessage("\nClient treminated connection");
                   catch(IOException ioException)
                             ioException.printStackTrace();
                   finally
                             closeConnection();
         private void connectToServer() throws IOException
                   displayMessage("Attempting connection\n");
                   client = new Socket(InetAddress.getByName(chatServer),12345);
                   displayMessage("Connect to:"+client.getInetAddress().getHostName());
         private void getStreams() throws IOException
                   output = new ObjectOutputStream(client.getOutputStream());
                   output.flush();
                   input = new ObjectInputStream(client.getInputStream());
                   //Thread t = new Thread(this,"Thread");
                   //t.start();
                   displayMessage("\nGot I/O stream\n");
         private void processConnection( ) throws IOException
                   setTextFieldEditable(true);
                   do
                             try
                                       message=(String)input.readObject();
                                       displayMessage("\n"+message);
                             catch(ClassNotFoundException classnotfoundexception)
                                       displayMessage("\nUnknown object type received");
                   while(!message.equals("SERVER>>>TERMINATE"));
         private void closeConnection()
                   displayMessage("\n Closing connection");
                   setTextFieldEditable(false);
                   try
                             output.close();
                             input.close();
                             client.close();
                   catch(IOException ioException)
                             ioException.printStackTrace();
         private void sendData(String message)
                   try
                             output.writeObject("CLIENT>>>"+message);
                             //System.out.println(message);
                             output.flush();
                             displayMessage("\nCLIENT>>>"+message);
                   catch(IOException ioException)
                             displayArea.append("\n Error writing object");
         private void displayMessage(final String MessageToDisplay)
                   SwingUtilities.invokeLater(
                        new Runnable()
                                  public void run()
                                            displayArea.append(MessageToDisplay);
         private void setTextFieldEditable(final boolean editable)
                   SwingUtilities.invokeLater(
                        new Runnable()
                                  public void run()
                                            enterField.setEditable(editable);
         public static void main(String q[])
                   Client app;
                   if(q.length==0)
                             app = new Client("127.0.0.1");
                   else
                             app = new Client(q[0]);
                   app.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
                   app.runclient();
    Use this example .....
    Give me reply.My method is correct or not
    All the best

  • ACC Client not connecting

    Hello,
    We installed ATG on the server and the Server ACC is working fine, but when we try to connect the Client ACC, we get the following error:
    Could not connect to URL rmi://<server-ip>:8861/atg/devtools/UpdateAgent
    Either the Dynamo server is not running, or the hostname and/or port number are invalid.
    When trying to use the ACC Client on the server machine (using the same configurations), the client connect but throws the following error when updating:
    Server returned HTTP response code: 500 for URL: http://<server-internal-ip>:8180/dyn/admin/dynamoModuleResource/?moduleName=DAS&resourceURI=j2ee-lib/jboss-javaee.jar
    Thanks in advance.

    Thanks for the repply. The second error we were able to resolve, now we can connect to the ACC Cliente in the server machine.
    But we still can't access the ACC Client remotely. We know the port is opened (we tested via Telnet), dynamo server is running (we can access it via browser) and the port is the same as the one in the server's machine, but we/'re still getting the following error:
    Could not connect to URL rmi://<server-ip>:8861/atg/devtools/UpdateAgent
    Either the Dynamo server is not running, or the hostname and/or port number are invalid.
    And in the terminal we get the following errors:
    java.rmi.ConnectException: Connection refused to host: localhost; nested exception is:
    java.net.ConnectException: Connection refused: connect
    at sun.rmi.transport.tcp.TCPEndpoint.newSocket(Unknown Source)
    at sun.rmi.transport.tcp.TCPChannel.createConnection(Unknown Source)
    at sun.rmi.transport.tcp.TCPChannel.newConnection(Unknown Source)
    at sun.rmi.server.UnicastRef.invoke(Unknown Source)
    at atg.ui.common.model.DynamoUpdateAgentImpl_Stub.isLicensedLocale(Unknown Source)
    at atg.applauncher.dynamo.DynamoClientLauncher.getLauncherFromArgs(DynamoClientLauncher.java:301)
    at atg.applauncher.dynamo.DynamoClientLauncher$ClientConnectionFrame.connect(DynamoClientLauncher.java:1144)
    at atg.applauncher.dynamo.DynamoClientLauncher$ClientConnectionFrame.actionPerformed(DynamoClientLauncher.java:1082)
    at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
    at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
    at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
    at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
    at javax.swing.AbstractButton.doClick(Unknown Source)
    at javax.swing.AbstractButton.doClick(Unknown Source)
    at atg.applauncher.dynamo.DynamoClientLauncher$ClientConnectionFrame$2.actionPerformed(DynamoClientLauncher.java:897)
    at javax.swing.JTextField.fireActionPerformed(Unknown Source)
    at javax.swing.JTextField.postActionEvent(Unknown Source)
    at javax.swing.JTextField$NotifyAction.actionPerformed(Unknown Source)
    at javax.swing.SwingUtilities.notifyAction(Unknown Source)
    at javax.swing.JComponent.processKeyBinding(Unknown Source)
    at javax.swing.JComponent.processKeyBindings(Unknown Source)
    at javax.swing.JComponent.processKeyEvent(Unknown Source)
    at java.awt.Component.processEvent(Unknown Source)
    at java.awt.Container.processEvent(Unknown Source)
    at java.awt.Component.dispatchEventImpl(Unknown Source)
    at java.awt.Container.dispatchEventImpl(Unknown Source)
    at java.awt.Component.dispatchEvent(Unknown Source)
    at java.awt.KeyboardFocusManager.redispatchEvent(Unknown Source)
    at java.awt.DefaultKeyboardFocusManager.dispatchKeyEvent(Unknown Source)
    at java.awt.DefaultKeyboardFocusManager.preDispatchKeyEvent(Unknown Source)
    at java.awt.DefaultKeyboardFocusManager.typeAheadAssertions(Unknown Source)
    at java.awt.DefaultKeyboardFocusManager.dispatchEvent(Unknown Source)
    at java.awt.Component.dispatchEventImpl(Unknown Source)
    at java.awt.Container.dispatchEventImpl(Unknown Source)
    at java.awt.Window.dispatchEventImpl(Unknown Source)
    at java.awt.Component.dispatchEvent(Unknown Source)
    at java.awt.EventQueue.dispatchEvent(Unknown Source)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
    at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
    at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    at java.awt.EventDispatchThread.run(Unknown Source)
    Caused by: java.net.ConnectException: Connection refused: 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 sun.rmi.transport.proxy.RMIDirectSocketFactory.createSocket(Unknown Source)
    at sun.rmi.transport.proxy.RMIMasterSocketFactory.createSocket(Unknown Source)
    ... 43 more
    java.net.ConnectException: Connection refused: 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 sun.rmi.transport.proxy.RMIDirectSocketFactory.createSocket(Unknown Source)
    at sun.rmi.transport.proxy.RMIMasterSocketFactory.createSocket(Unknown Source)
    at sun.rmi.transport.tcp.TCPEndpoint.newSocket(Unknown Source)
    at sun.rmi.transport.tcp.TCPChannel.createConnection(Unknown Source)
    at sun.rmi.transport.tcp.TCPChannel.newConnection(Unknown Source)
    at sun.rmi.server.UnicastRef.invoke(Unknown Source)
    at atg.ui.common.model.DynamoUpdateAgentImpl_Stub.isLicensedLocale(Unknown Source)
    at atg.applauncher.dynamo.DynamoClientLauncher.getLauncherFromArgs(DynamoClientLauncher.java:301)
    at atg.applauncher.dynamo.DynamoClientLauncher$ClientConnectionFrame.connect(DynamoClientLauncher.java:1144)
    at atg.applauncher.dynamo.DynamoClientLauncher$ClientConnectionFrame.actionPerformed(DynamoClientLauncher.java:1082)
    at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
    at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
    at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
    at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
    at javax.swing.AbstractButton.doClick(Unknown Source)
    at javax.swing.AbstractButton.doClick(Unknown Source)
    at atg.applauncher.dynamo.DynamoClientLauncher$ClientConnectionFrame$2.actionPerformed(DynamoClientLauncher.java:897)
    at javax.swing.JTextField.fireActionPerformed(Unknown Source)
    at javax.swing.JTextField.postActionEvent(Unknown Source)
    at javax.swing.JTextField$NotifyAction.actionPerformed(Unknown Source)
    at javax.swing.SwingUtilities.notifyAction(Unknown Source)
    at javax.swing.JComponent.processKeyBinding(Unknown Source)
    at javax.swing.JComponent.processKeyBindings(Unknown Source)
    at javax.swing.JComponent.processKeyEvent(Unknown Source)
    at java.awt.Component.processEvent(Unknown Source)
    at java.awt.Container.processEvent(Unknown Source)
    at java.awt.Component.dispatchEventImpl(Unknown Source)
    at java.awt.Container.dispatchEventImpl(Unknown Source)
    at java.awt.Component.dispatchEvent(Unknown Source)
    at java.awt.KeyboardFocusManager.redispatchEvent(Unknown Source)
    at java.awt.DefaultKeyboardFocusManager.dispatchKeyEvent(Unknown Source)
    at java.awt.DefaultKeyboardFocusManager.preDispatchKeyEvent(Unknown Source)
    at java.awt.DefaultKeyboardFocusManager.typeAheadAssertions(Unknown Source)
    at java.awt.DefaultKeyboardFocusManager.dispatchEvent(Unknown Source)
    at java.awt.Component.dispatchEventImpl(Unknown Source)
    at java.awt.Container.dispatchEventImpl(Unknown Source)
    at java.awt.Window.dispatchEventImpl(Unknown Source)
    at java.awt.Component.dispatchEvent(Unknown Source)
    at java.awt.EventQueue.dispatchEvent(Unknown Source)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
    at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
    at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    at java.awt.EventDispatchThread.run(Unknown Source)

  • DirectAccess Client not connecting without error code on Windows Server 2012 R2 and Windows 8.1

    Hello,
    we are currently migrating from Windows Server 2012 to 2012 R2 and are not able to get the new Direct Access Service up and running. Our goal is to establish DirectAccess connection for a handful of clients using the IPHTTPS-adapter on the default port 443.
    Errors:
    There is actually no error showing up. It seems the infrastructure tunnel cannot be created but none of the IPv6-transition adapters is connecting (teredo and 6-to-4 are down) and the IPHTTPs adapter gives no informations about a problem:
    >Get-DAConnectionStatus
    Status    : Error
    Substatus : CouldNotContactDirectAccessServer
    >Get-NetIPHttpsState
    LastErrorCode   : 0x0
    InterfaceStatus : Failed to connect to the IPHTTPS server; waiting to reconnect
    Setup:
    Our setup is a virtualized Windows Server 2012 R2 Standard running on Hyper-V. It is located behind a NAT having the Port 443 mapped to the server. The only role installed after the basic install is RRAS including DirectAccess and VPN. The assistants completed
    successfully (running the configuration for DirectAccess and VPN). Operation Status says everything is green und working (for multiple days in the meanwhile). A previous direct access installation (on a different machine running Windows Server 2012) has
    been removed before installing the new server. The new installation is using a different router, so this might also be the cause of a problem.
    The client is a Windows 8.1 notebook located outside the company network accessing the internet through another NAT-device. The client has been able to connect to the previous DirectAccess setup but has never been able to establish a connection after the
    setup of the new Direct Access server. The device has no outbound constraints concerning the NAT-device and is only running the integrated Windows Firewall.
    Diagnosis:
    So far I've done some basic DNS and connectivity checks. The DNS-name can be resolved correctly and the router even responds to pings. The port forward is working and HTTPs connections are generally possible (temporarily routed the port to
    access the NLS-Website located on the server, which worked fine).
    Network monitor shows that both computers are communicating, traffic on the expected Port 443 is incoming on the server and responses from the server reach the client.
    Opening the IPHTTPs-url and in an endless page load. Sometime the browser page closes but I've never seen any result. Using telnet on the port shows that the server is accepting connections. I've even build a small test application that does a GET-Request
    on the URL returning HTTP-200 and no content.
    I'm currently running out of ideas what to do and since no error occurs this is kind of a bit frustrating. Any help appreciated.
    Regards
    Matthias

    Hi,
    In addition, have you disabled the DA client components on the DA client? If no, please also check
    the settings on the Name Resolution Policy Table.
    More information:
    DirectAccess
    Client Location Awareness – NRPT Name Resolution
    In addition, error 0x4C9 means the remote computer refused the network connection. It may be due to the invalid
    registry or corrupt drivers. For more detailed information, please refer to the link below:
    Error 1225 - Error Code 0x4C9
    Note:
    Microsoft is providing this information as a convenience to you. Please make sure that you completely understand the risk before retrieving any suggestions from the above link.
    Best regards,
    Susie

  • Starting Blend when client not connected to internet?

    I've recently started experimenting with Blend with my Z30 and my laptop running Windows 7 Enterprise sp1; Blend Windows client v.1.1.0.17, Blackberry Blend app v.1.1.0.67 on the Z30.
    One thing we'd like to do is to use it in places where we have no internet access other than through the mobile network on the Blackberry. Essentially tethering only for Blend. 
    Blend works fine if the laptop is connected to the internet, the Z30 connected to the mobile network, and the two are connected by USB. Once Blend is connected, I can then disconnect the laptop from the internet, but leave the phone connected to the laptop via USB, and Blend continues working without any problems, using only the mobile network.
    However, if the laptop is not connected to the internet when I actually start Blend, I generally cannot get it to connect at all. I plug the Z30 into the laptop, start Blend, and it will go through Discovering, Connecting, Verifying Secure Connection, then end up with a "Can't Connect" message. 
    I say "generally" because Blend will connect if I try to do it within a very short time after disconnecting the laptop from the internet. It won't work, however, if, for example, I start up or resume the laptop somewhere where I don't have an internet connection for the laptop.
    I'm guessing that the Blend client on the desktop does some initial verification prior to establishing the USB connection with the Z30 that requires an independent internet connection, and if it cannot do this it won't connect.
    I also note that Blackberry Link on the laptop will crash if run when the laptop is not connected to the internet, and am guessing this might be related.
    Can Blend be started when the only internet connection available is through the mobile network on the phone?
    -- BV

    Following up on my earlier post; I also have a Playbook, and one of the most useful features is Blackberry Bridge, which provided similar functionality as Blend, though (only) over Bluetooth, and only between a Blackberry and the Playbook. Blend looks like it provides similary functionality, but on more devices, which is great.
    Blackberry Bridge, however, does not require the Playbook to have an internet connection to work; I hoped Blend would work in the same way, thus my original post. FYI, I am a lawyer, and in my practice I am often at a tribunal or court where I do not have wifi access, and being able to use Blend to access my email and office intranet on the laptop would be a very useful feature.
    I also note that Blend doesn't support Bluetooth; not a big deal, as a USB connection is fine, just curious. And I suppose that there is a good reason for the client requiring a separate internet connection, even if no one here seems to know why .
    -- BV

Maybe you are looking for

  • Notebook Lenovo V570c и Windows XP

    Здравствуйте , раз уж мне выпала честь открыть первой темой этот раздел. Имею ноутбук V570c В использовании в рабочих целях выявилась не обходимость пользоваться старыми программами и соотвественно к ним требуются старые ОС. Моя конкретно модификация

  • Apple tv not showing on iPad

    I have had the new Apple TV for almost a year and recently it has just started working very sporadically. Sometimes it just says that home sharing is not on (which it is). The iPad just doesn't find it on AirPlay (does home sharing have to be working

  • Looking for a better way to backup end users

    Hello there. Not sure if this the best forum for this post but here goes. Last week my company had a break in and a couple of laptops got lifted. Not a big deal as I had backups of the machines on tape. It did take a while to recover the files though

  • "Server crash detected (signal SIGSEGV)" on startup, iPlanet 6 sp2, SDK 1.3.1_03, Linux glibc 2.2.4

    When installing with the bundled JRE 1.2.2 (I think) I don't have this problem. The Pooblem existed with SDK 1.3.1_01 so I upgraded to 1.3.1_03. There were some notes in that release that a signal 11 caused by hotspot had been fixed, but the problem

  • How to get update KB3008273 on my 2012R2 WSUS Server

    I am not sure if this is a WSUS issue or not, I can not find KB3008273 on my WSUS server and I have the Windows 8 updates selected, I also tried to download it from the Windows Update Catalog and it is not available on that site either.  I looked at