Keep alive connection

Hi,
I write a report that works on a lot of data and when it starts, it takes about an hour or two for processing. The problem is that on the system there is a timout of 20 minutes of inactivity after which the use il logged out.
The question is: is there a way by code to advise a sort of keep alive so that user is not logged out?
(I can't change the timeout on the system for security issues)
Thanks
Gabriele

the problem is not that process is in foreground or background: the problem is the timeout: I need to avoid timeout, because the idea is to launch the report and then go out for lunch So I need to find a way in the code to advise the system that user has not to be logged out.
Thanks
Gabriele

Similar Messages

  • Weblogic proxy plugin closes keep-alive connections to clients randomly

    In short we have following arhitecture:
    clients ---> wl proxy plugin 1 ----> weblogic 1
    clients ---> wl proxy plugin 2 ----> weblogic 2
    Beacuse of the application/installation specific requirements, we are not using failover, one wl proxy always forwards requests to one weblogic (simple configuration).
    Application is TR-069 protocol based (SOAP over HTTP) so it very much relays on persistence TCP connections (Connection: keep-alive). This TCP persistence has to work correctly in order that TR-069 messages are exchanged in required order, otherwise we have a error on application layer.
    Here and there we've noticed applications errors which suggest that we have some problems in TCP connection between the client and the weblogic server. After sniffing, we've noticed that weblogic proxy plugin (Apache) randomly, or because of some other reason we do not know, decides to close TCP connection to client, even app on weblogic did not request so ???
    As a result, client opens new connection to the server with new TR-069 session and it gets bounced beacuse it allready has one open on weblogic server.
    We've sniffed, traced everything we could, we were searching for patterns in time, etc... but we can not find the reason why proxy plugin decides to close the connection to the client (not to the weblogic server).
    Trace (replaced sensitive information):
    Thu Apr 29 15:05:50 2010 <958012725463463784> URL::parseHeaders: CompleteStatusLine set to [HTTP/1.1 200 OK]
    Thu Apr 29 15:05:50 2010 <958012725463463784> URL::parseHeaders: StatusLine set to [200 OK]
    Thu Apr 29 15:05:50 2010 <958012725463463784> parsed all headers OK
    Thu Apr 29 15:05:50 2010 <958012725463463784> sendResponse() : r->status = '200'
    Thu Apr 29 15:05:50 2010 <958012725463463784> canRecycle: conn=1 status=200 isKA=1 clen=545 isCTE=0
    Thu Apr 29 15:05:50 2010 <958012725463463784> closeConn: pooling for '$IP$/$PORT$'
    Thu Apr 29 15:05:50 2010 <958012725463463784> request [$URL$] processed successfully..................
    !!!! Now it closes the TCP connection and inserts "Connection: close" HTTP header !!!
    WL proxy plugin conf params are:
    WebLogicCluster $IP$:$PORT$
    DynamicServerList OFF
    KeepAliveTimeout 90
    MaxKeepAliveRequests 0
    KeepAliveSecs 55
    Apache worker configuration is:
    <IfModule mpm_worker_module>
    PidFile var/run/httpd-worker.pid
    LockFile var/run/accept-worker.lock
    StartServers 2
    MinSpareThreads 25
    MaxSpareThreads 75
    ThreadLimit 200
    ThreadsPerChild 200
    MaxClients 2000
    MaxRequestsPerChild 0
    AcceptMutex pthread
    </IfModule>
    Why weblogic proxy plugin ignores Keep-alive directive and decides to close connection to the client by itself?
    Any help?

    If a WebLogic Server instance listed in either the WebLogicCluster parameter or a dynamic cluster list returned from WebLogic Server fails, the failed server is marked as "bad" and the plug-in attempts to connect to the next server in the list.
    MaxSkipTime sets the amount of time after which the plug-in will retry the server marked as "bad." The plug-in attempts to connect to a new server in the list each time a unique request is received (that is, a request without a cookie).
    Note: The MaxSkips parameter has been deprecated as the MaxSkipTime parameter.
    See also here: http://download-llnw.oracle.com/docs/cd/E13222_01/wls/docs81/plugins/plugin_params.html
    You said the problem arises under significant load. Maybe, it is wise to tune the number file descriptor's on your operating system. HTTP connections are nothing more than TCP sockets on the operating system. All modern operating systems treat sockets as a specialized form of file access and use data structures called file descriptors to track open sockets and files for an operating system process. To control resource usage for processes on the machine, the operating system restricts the number of open file descriptors per process. You should be aware that all TCP connections that have been gracefully closed by an application will go into what is known as the TIME_WAIT state before being discarded by the operating system.
    On most unix systems you can use netstat -a | grep TIME_WAIT | wc -l to detemine the number of socket in time_wait state. You have to check with your system adminstrator how to tune the tcp_time_wait_interval. On solaris you can use: /usr/sbin/ndd -set /dev/tcp tcp_time_wait_interval 60000

  • LDAP keep-alive connection ? (use of ldap_io_fns)

    Hi there,
    I am facing a new req. from network security guys that want to close 'idle' connections that crosses firewalls. But as I do use persistent search connection which are not very 'busy' => i.e. not enough traffic to be kept open by FireWall rule.
    Consequence my client could not 'detect' this cut of connection and do not receive any more the 'updates' through persistent search.
    I am now trying to init my connection setting optional io_fns structure changing the socket func by my socket func that do create a keep-alive socket.
    But it does not bind properly ... Init seem ok but bind never get out. LDAP receives bind and do log it but seem not able to respond properly ...
    Any idea on how to use this io_fns struct ?
    Many thanks.
    Hedi.
    .

    the problem is not that process is in foreground or background: the problem is the timeout: I need to avoid timeout, because the idea is to launch the report and then go out for lunch So I need to find a way in the code to advise the system that user has not to be logged out.
    Thanks
    Gabriele

  • Keep-alive connection between app and servlet

    Hi,
    I have searched the forum for information about how to keep a
    connection alive between a client app and a servlet, but I have not been
    able to find anything.
    Does someone have an example of how to do this? Please send it!
    Thanks!

    HTTP connections are transient, they're not meant to be kept open.
    HTTP 1.1 can support this feature, check the RFC and servlet specification (and probably the appserver documentation for configuration).
    Best use another protocol though, ftp for example (or something else entirely).

  • IllegalStateException Keep Alive Connection not initialized

    Dear all,
    I would like to solicit for some helpful hints. I have a small midlet running under the WTK22 emulator just fine on my dev machine.
    However, on another machine, I get the following exception:
    Exception in thread "main" java.lang.IllegalStateException: KeepAliveConnection not initialized
    at com.sun.kvem.environment.KeepAliveConnection.run(Unknown Source)
    at com..sun.kvem.environment.EmulatorWrapper.main(Unknown Source)
    While there are few reports of this nature, I can't seem to find any answers on the net.
    I'm using Windows XP, with WTK22 on both environments. On both environments, all the demos seem to run fine.
    Any helpful comments would be welcome.
    Thanks.
    KHK

    I get the same issue with WTK2.2 under FC5 64bit Linux. Any ideals about what is causing this??
    Thanks

  • Keep-alive message bridge connection

    Hi,
    I have setup messaging bridge between WLS 10.3.0.0 and a JBoss Messaging queque, after about 4 hours of inactivity in a queue bridge was disconneted, is there any way to configure keep-alive connection in WLS bridge ?
    Thanks,
    Lukasz

    You can try to set the IdleTimeMaximum setting on your bridge configuration to a very large number. It specifies the maximum amount of time, in seconds, that a messaging bridge instance remains idle.
    In “asynchronous” mode, this is the longest amount of time a messaging bridge instance stays idle before it checks the sanity of its connection to the source. In “synchronous” mode, this is the amount of time the messaging bridge can block on a receive call if no transaction is involved.
    -Dongbo

  • URLConnection POST to external server requiring keep-alive fails because request is HTTP/1.0

              I have a class that when run as a "main" transmits a HTTP/1.1 post successfully
              to an external server. This external server requires keep-alive connections.
              However when instantiated inside a weblogic servlet container, the post fails
              because the HTTP protocol is set to HTTP/1.0. I have tried this with V5.1 SP11
              and then with V6.1 SP2 with the same result. The code works under Tomcat.
              I can find no way to force HTTP/1.1 in the URLConnection. Any suggestions?
              

    Great. I have a question to BEA folks, if they ever read this newsgroup:
              what is the reason for installing WLS protocol handlers, and, if there is
              one, why the implementation is still buggy? I saw many, many instances when
              code making outgoing connections failed to work in WLS, and the solution is
              always the same - use handler which comes with the JVM.
              Bob Bowman <[email protected]> wrote:
              > <[email protected]> wrote:
              >>If it works as a standalone application and fails inside WebLogic, most
              >>likely this
              >>is caused by WebLogic http handler implementation. You can try to modify
              >>your code
              >>like this:
              >>
              >>URL url = new URL(null, "http://some_url", new sun.net.www.protocol.http.Handler());
              >>HttpURLConnection conn = (HttpURLConnection)url.openConnection();
              >>
              >>(you will need to modify weblogic.policy to allow your code to specify
              >>protocol
              >>handler).
              >>
              >>Bob Bowman <[email protected]> wrote:
              >>
              >>> I have a class that when run as a "main" transmits a HTTP/1.1 post
              >>successfully
              >>> to an external server. This external server requires keep-alive connections.
              >>> However when instantiated inside a weblogic servlet container, the
              >>post fails
              >>> because the HTTP protocol is set to HTTP/1.0. I have tried this with
              >>V5.1 SP11
              >>> and then with V6.1 SP2 with the same result. The code works under
              >>Tomcat.
              >>
              >>> I can find no way to force HTTP/1.1 in the URLConnection. Any suggestions?
              >>
              >>--
              >>Dimitri
              > Worked like a champ! Thanks.
              Dimitri
              

  • Speed limit on pipelining keep-alive requests?

    Hi all,
              I was wondering if anyone knows of a limit in how fast weblogic can
              handle multiple servlet requests over a keep-alive connection.
              We were trying to throw a bunch for testing purposes, and it seems that
              if we bunch them closer together than ~300ms, it won't handle more than
              two. (I can recreate the problem by hand, too)
              Is this a limit in Weblogic 6?
              Thanks,
              Dave
              ps: here's the exception trace:
              <Mar 5, 2001 4:15:53 PM EST> <Error> <Posix Performance Pack> <Uncaught
              Throwable in processSockets
              java.lang.NullPointerException
              at weblogic.socket.TunnelContext.getServlet(TunnelContext.java:24)
              at weblogic.servlet.internal.MuxableSocketHTTP.dispatch(MuxableSocketHTT
              P.java:459)
              at
              weblogic.socket.PosixSocketMuxer.deliverGoodNews(PosixSocketMuxer.jav
              a:449)
              at
              weblogic.socket.PosixSocketMuxer.processSockets(PosixSocketMuxer.java
              :378)
              at
              weblogic.socket.SocketReaderRequest.execute(SocketReaderRequest.java:
              23)
              at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:137)
              at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
              >
              

    Hi all,
              I was wondering if anyone knows of a limit in how fast weblogic can
              handle multiple servlet requests over a keep-alive connection.
              We were trying to throw a bunch for testing purposes, and it seems that
              if we bunch them closer together than ~300ms, it won't handle more than
              two. (I can recreate the problem by hand, too)
              Is this a limit in Weblogic 6?
              Thanks,
              Dave
              ps: here's the exception trace:
              <Mar 5, 2001 4:15:53 PM EST> <Error> <Posix Performance Pack> <Uncaught
              Throwable in processSockets
              java.lang.NullPointerException
              at weblogic.socket.TunnelContext.getServlet(TunnelContext.java:24)
              at weblogic.servlet.internal.MuxableSocketHTTP.dispatch(MuxableSocketHTT
              P.java:459)
              at
              weblogic.socket.PosixSocketMuxer.deliverGoodNews(PosixSocketMuxer.jav
              a:449)
              at
              weblogic.socket.PosixSocketMuxer.processSockets(PosixSocketMuxer.java
              :378)
              at
              weblogic.socket.SocketReaderRequest.execute(SocketReaderRequest.java:
              23)
              at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:137)
              at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
              >
              

  • GRE VPN & KEEP ALIVE

    Dear all,
    i am having problem with make keep alive connectivity all the time between 2 nodes.
    I have A and B cisco routers established GRE VPN over ISP. Problem starts with when there are no active connection from host of A to host of B. It looks like  VPN down. Another problem is when A 's having temp power outage and when power comes there is no active connection even WAN protocol is down.When reload A router manually then connection comes up.
    I am thinking that maybe some configuation like keep alive retry something like that.
    Do guys have any idea on this matter ?

    GRE tunnels are usually used in combination with a dynamic routing protocol that keeps the tunnel up and active. If you are using static routes there is no traffic to keep the tunnels up when the applications are not transmitting.
    You have two options:
    1. Increase the isakmp/ipsec lifetimes.
    http://www.cisco.com/en/US/products/sw/iosswrel/ps1831/products_configuration_guide_chapter09186a00800d981f.html#1001095
    2. Setup keepalives (Best Option)
    crypto isakmp keepalive (Number of seconds between keep alives) (Number of seconds between retries if keepalive fails)

  • HttpConnection keep-alive

    Hello!
    Guys i need your help to create a connection to web server with DataOutputStream and DataInputStream.
    The problem is that I need to create connection that can be open all the time and I can write and read data from server.
    I had make some variant but it's working only first time, after it say's connection already open.
    here are code, little bit different, now it says Write attempted after request finished
    here is source code
    package super_7_blackjack;
    import java.io.DataInputStream;
    import java.io.DataOutputStream;
    import java.io.IOException;
    import java.io.InputStream;
    import javax.microedition.io.Connector;
    import javax.microedition.io.HttpConnection;
    public class HTTPQuery {
            private HttpConnection connection;
            private DataOutputStream dos;
            private DataInputStream dis;
            private String URL;
            private String sessionId;
            public HTTPQuery(String URL, String sessionId) {
                System.out.println("URL=" + URL);
                this.URL = URL;
                this.sessionId = sessionId;
                try {
                    connection = (HttpConnection)Connector.open(URL);
                    connection.setRequestProperty("Content-type", "application/x-www-form-urlencoded");
                    connection.setRequestProperty("cookie","JSESSIONID=" + sessionId + "; AnyJavaPresent=1.4.2_05");
                    connection.setRequestProperty("Cache-Control","no-cache");
                    connection.setRequestProperty("Pragma","no-cache");
                    connection.setRequestProperty("User-Agent","Mozilla/4.0 (Windows XP 5.1) Java/1.4.2_05");
                    connection.setRequestProperty("Accept","text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2");
                    connection.setRequestProperty("Connection","keep-alive");
                    connection.setRequestMethod("POST");
                    if( connection.getResponseCode() == HttpConnection.HTTP_OK ) {
                        dos = new DataOutputStream(connection.openOutputStream());
                        dis = new DataInputStream(connection.openInputStream());
                } catch (IOException ieox) {
                 System.out.println("Error while opening connection.");
         public synchronized String executeRequestQuery(String query) {
              StringBuffer b = new StringBuffer();
              long len = 0;
              try {
                   dos.write(query.getBytes());
                   dos.flush();
                   DataInputStream dis = new DataInputStream(connection.openInputStream());
                   len = connection.getLength();
                   if (len!=-1) {
                                byte servletData[] = new byte[(int)len];
                                dis.readFully(servletData);
                                b.append(new String(servletData));
                             } catch (Exception e) {
                        System.out.println("Error while closing: "  + e.getMessage());
              System.out.println(b.toString());
              return b.toString();
    }and I use it
    httpQuery = new  HTTPQuery(URL,sessionId);
    httpQuery.executeRequestQuery("CREATESESSION=NO&CMD=ENTER&DBLINK=DBLINKFREE1");

    jhd
    package super_7_blackjack;
    import java.io.DataInputStream;
    import java.io.DataOutputStream;
    import java.io.IOException;
    import java.io.InputStream;
    import javax.microedition.io.Connector;
    import javax.microedition.io.HttpConnection;
    public class HTTPQuery {
            private HttpConnection connection;
            private DataOutputStream dos;
            private DataInputStream dis;
            private String URL;
            private String sessionId;
            public HTTPQuery(String URL, String sessionId) {
                System.out.println("URL=" + URL);
                this.URL = URL;
                this.sessionId = sessionId;
                try {
                    connection = (HttpConnection)Connector.open(URL);
                    connection.setRequestProperty("Content-type", "application/x-www-form-urlencoded");
                    connection.setRequestProperty("cookie","JSESSIONID=" + sessionId + "; AnyJavaPresent=1.4.2_05");
                    connection.setRequestProperty("Cache-Control","no-cache");
                    connection.setRequestProperty("Pragma","no-cache");
                    connection.setRequestProperty("User-Agent","Mozilla/4.0 (Windows XP 5.1) Java/1.4.2_05");
                    connection.setRequestProperty("Accept","text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2");
                    connection.setRequestProperty("Connection","keep-alive");
                    connection.setRequestMethod("POST");
                    if( connection.getResponseCode() == HttpConnection.HTTP_OK ) {
                        dos = new DataOutputStream(connection.openOutputStream());
                        dis = new DataInputStream(connection.openInputStream());
                } catch (IOException ieox) {
                 System.out.println("Error while opening connection.");
         public synchronized String executeRequestQuery(String query) {
              StringBuffer b = new StringBuffer();
              long len = 0;
              try {
                                                               dos = new DataOutputStream(connection.openOutputStream());
                   dos.write(query.getBytes());
                   dos.flush();
                   DataInputStream dis = new DataInputStream(connection.openInputStream());
                   len = connection.getLength();
                   if (len!=-1) {
                                byte servletData[] = new byte[(int)len];
                                dis.readFully(servletData);
                                b.append(new String(servletData));
                             } catch (Exception e) {
                        System.out.println("Error while closing: "  + e.getMessage());
              System.out.println(b.toString());
              return b.toString();
    dos.close();
    dis.close();
    }see in block latter what you need to change is>>>>
    this will not going to close your HttpConnection but it will close only ur Stream connection and that will not required never at all.
    try with this code i hope this will helps you.
    Regards,
    Jasmit vala
    [email protected]

  • Please Help - To keep LDAP connection alive

    Hi,
    I have used the below function to communicate with LDAP which I have taken and modified from one of the posts in this forum.
    My issue is, each time the function opens a connection, search and closing the connection and its seriously affects the performance.
    I hope we can resolve this by keeping the connection alive. As I am new to this concept, I am not sure how to do this.
    It would be great, if some one help me to keep the connection alive for the below function. Thanks in advance.
    create or replace FUNCTION <name> (loginname VARCHAR2)
    RETURN NUMBER
    IS
    -- Adjust as necessary.
    l_ldap_host VARCHAR2(256) := '';
    l_ldap_port VARCHAR2(256) := '';
    l_ldap_user VARCHAR2(256) := '';
    l_ldap_passwd VARCHAR2(256) := '';
    l_ldap_base VARCHAR2(256) := '';
    l_retval PLS_INTEGER;
    l_session DBMS_LDAP.session;
    l_attrs DBMS_LDAP.string_collection;
    l_message DBMS_LDAP.message;
    l_filter varchar2(35):='xxxx='|| loginname;
    l_count NUMBER:=0;
    BEGIN
    -- Choose to raise exceptions.
    DBMS_LDAP.USE_EXCEPTION := TRUE;
    -- Connect to the LDAP server.
    l_session := DBMS_LDAP.init(hostname => l_ldap_host,portnum => l_ldap_port);
    l_retval := DBMS_LDAP.simple_bind_s(ld => l_session,dn => l_ldap_user,passwd => l_ldap_passwd);
    -- Get attribute
    l_attrs(1) := 'xxxx';
    l_retval := DBMS_LDAP.search_s(ld => l_session, base => l_ldap_base, scope => DBMS_LDAP.SCOPE_SUBTREE, filter => l_filter, attrs => l_attrs, attronly => 0, res => l_message);
    l_count:=DBMS_LDAP.count_entries(ld => l_session, msg => l_message);
    -- Disconnect from the LDAP server
    l_retval := DBMS_LDAP.unbind_s(ld => l_session);
    return l_count;
    EXCEPTION
    WHEN OTHERS THEN
    dbms_output.put_line('Error :'||SQLERRM);
    return 0;
    END <fun name>;
    Thanks,
    Praveen
    Edited by: 920577 on Mar 13, 2012 9:40 AM
    Edited by: 920577 on Mar 13, 2012 9:41 AM

    The basic template looks as follows:
    SQL> create or replace package Foo as
      2 
      3  procedure LdapLogoff;
      4  function GetData( empName varchar2 )  return number;
      5 
      6  end;
      7  /
    Package created.
    SQL>
    SQL> create or replace package body Foo as
      2 
      3  isLoggedOn boolean;
      4 
      5  procedure LdapLogon is
      6  begin
      7          DBMS_OUTPUT.put_line( '..running logon()' );
      8          isLoggedOn := true;
      9  end;
    10 
    11  procedure LdapLogoff is
    12  begin
    13          DBMS_OUTPUT.put_line( '..running logoff()' );
    14          isLoggedOn := false;
    15  end;
    16 
    17  function GetData( empName varchar2 ) return number is
    18  begin
    19          if not isLoggedOn then
    20                  LdapLogon();
    21          end if;
    22         
    23          DBMS_OUTPUT.put_line( '..running GetData() for '||empName );
    24          return(
    25                  round(DBMS_RANDOM.Value(1,100))
    26          );
    27  end;
    28 
    29 
    30  --// main()
    31  begin
    32          DBMS_OUTPUT.put_line( 'Package Foo loaded into memory' );
    33          isLoggedOn := false;
    34  end;
    35  /
    Package body created.
    SQL>
    SQL>
    SQL> select empno, ename, Foo.GetData(ename) as ID from emp order by empno;
         EMPNO ENAME              ID
          7369 SMITH              23
          7499 ALLEN              47
          7521 WARD               88
          7566 JONES              71
          7654 MARTIN             91
          7698 BLAKE              28
          7782 CLARK              92
          7788 SCOTT              91
          7839 KING               48
          7844 TURNER             89
          7876 ADAMS              64
          7900 JAMES              16
          7902 FORD               18
          7934 MILLER             35
    14 rows selected.
    Package Foo loaded into memory
    ..running logon()
    ..running GetData() for SMITH
    ..running GetData() for ALLEN
    ..running GetData() for WARD
    ..running GetData() for JONES
    ..running GetData() for MARTIN
    ..running GetData() for BLAKE
    ..running GetData() for CLARK
    ..running GetData() for SCOTT
    ..running GetData() for KING
    ..running GetData() for TURNER
    ..running GetData() for ADAMS
    ..running GetData() for JAMES
    ..running GetData() for FORD
    ..running GetData() for MILLER
    SQL>
    SQL> select empno, ename, Foo.GetData(ename) as ID from emp where rownum = 1;
         EMPNO ENAME              ID
          7369 SMITH               9
    ..running GetData() for SMITH
    SQL>
    // call Foo.Logoff manually when done, or leave it to
    // Oracle to close and release resources when the
    // session terminates

  • How to keep the connection alive?

    Hello! Happy new year!
    I have to write an HTTP server that comunicates with many clients in the same time,but keeps the connection with a client open if there the corresponding header is Keep-Alive. I have used threads,and I've tested my program in the following way: I've requested the one page of the site and then I've followed a link from that page. I expected that the broowser and the server talk to the same thread every time,but it seems that they don't. The code I've written is:
    //HTTPServer class
    ServerSocket serverSocket = null;
            boolean listening = true;
            try {
                serverSocket = new ServerSocket(80);
            } catch (IOException e) {
                System.err.println("Could not listen on port: 80.");
                System.exit(-1);
            while (listening)
                  new HTTPMultiServerThread(serverSocket.accept()).start();
    //HTTPMultiServerThread
    public void run() {
         //     System.out.println(socket.toString());
              try {
    while(!serverSocket.isClosed())){
                  DataOutputStream out = new DataOutputStream(socket.getOutputStream());
                  DataInputStream in = new DataInputStream( socket.getInputStream());
                  int nrBytes = in.available();
                  if(nrBytes > 0){
                       byte[] bytes = new byte[nrBytes];
                       in.read(bytes);
                       System.out.println("Procesez mesajul:" + nrBytes + new String(bytes));
                       HTTPMessage processedMess = new HTTPMessage(bytes).processMessage();
                       System.out.println("Inchid conexiunea.");
                        log("log.txt", new HTTPMessage(bytes).getStatusLine() + " " + new Data().getCurrentTime());
                   //send the message   
    out.write(processedMess.getBytes(),0,processedMess.getBytes().length);
                       /* inchid conexiunea
                  else{
                       String ret = new String("HTTP/1.1 500 Internal Server Error\n");
                        ret += "Host: cristi\n";
                      ret += "Date: " + new Data().getCurrentTime()+"\r\n";
                      ret += "\r\n";
                      ret += "<html><body><p>HTTP/1.1  500 Internal Serve Error</p> </body><html>\r\n";
                      out.write(ret.getBytes());
                  out.close();
                  in.close();
                       if(new HTTPMessage(bytes).getHeaderValue("Connection").equals("Close"))
                  socket.close();
         }//end while
              } catch (IOException e) {
                  e.printStackTrace();
        }I would also like to know how many clients are waiting to be served,in order to develop statistics about the server response time. 10X

    hi
    same to u .
    i think what i get from ur code that ....
    use some vector at the server side and whenever any client is connected (offcourse first time or not (depend on u !!)) create an object corresponding(generally created by server for every client) ..
    save this in the vector .. and pass it the size of vector to the client with the response .
    may this help u .
    regards
    akash
    Indiagames Ltd
    [email protected]
    India

  • ADK - Keeping EIS Connections Alive

    Hi,
              I am using the ADK that comes with WL 8.1 SP3. The challenge I am facing is to keep my connections alive while there is no activity (at the TCP/IP socket level) between the app server and the EIS.
              The EIS closes any sockets after 30 minutes of inactivity causing the connections to go into CLOSE_WAIT state.
              Is there any method I can use within the connector to keep pinging the server and make sure these connections have TCP/IP traffic?
              Has anyone used the <test-frequency-seconds> weblogic-ra.xml? What is its purpose? pinging?
              Appreciate your insight..

    Hi
              I have a requirement, which is some what similar to what is mentioned above.
              I too have to ping the interface at regular intervals to keep the connection alive. I also assumed that, we can use the test-frequency-seconds attribute. But for that to work, we have to implement the interface, http://java.sun.com/j2ee/1.4/docs/api/javax/resource/spi/ValidatingManagedConnectionFactory.html, which is there only from weblogic 9.
              But since our client is using weblogic 8.1, we are tied to that version.
              Can anyone please assist in solving this.

  • How do I change the http connection type from close to keep-alive

    I am using a browser that appears as though it needs a connection type of keep-alive. When a page is requested the server sends back a connection type of close. It appears images are not requested from the server when this connection type is requested.

    Some older web server provides inaccurate content-length information.If the content length value is less than the amount of data,the web server treats the difference as a new request, this creates problem with iplanet Web Server.
    If you are using browser with HTTP1.1 enabled, choose the option to enable it manually and try once again by posting the request.
    Hope it helps.

  • Workstation keep-alive and connectivity failure detection

    Dear all,
    I intend to automatically detect network failures from my workstation client and have it attempt to reconnect to the server on its own.
    Browsing the documentation for related information I saw the keep-alive option. If I understood correctly you can have the workstation generate periodic keep-alive messages to the server and if these are not acknowledged, all subsequent ATMI calls will fail with TPESYSTEM.
    My doubts regarding this are the following:
    1) Is there some dummy ATMI function I can invoke periodically to check for a disconnection? Otherwise network failures might go by unnoticed if there are periods where my WSC doesn't require to communicate with the server.
    2) Once I get a TPESYSTEM failure, is there some way to programatically discriminate if the cause is a network disconnection? It is a pretty generic error after all.
    3) Once all ATMI functions start failing due to keep-alive detecting a network failure, can the system recover on its own? or must I reconnect to the server? What I mean is, maybe some keep alive messages where lost, the system passes to the 'disconnected' state, but then the K.A. messages keep being generated and upon correct acknowledgement of these, subsequent ATMI calls will stop failing.
    4) Does the WSC go to 'disconnected' state after the first unanswered keep alive message? or is there some sort of tolerance like, say, 'If N messages in a row are not answered then assume the connection to be dead'.
    I'm sorry if it was too long a post, but neither searching the documentation nor this forum clarified any of these issues for me.
    Many thanks for your attention.
    Regards.

    Cacho,
    1. I assume that you're talking about the WSL CLOPT option "-K
    {client|handler|both|none}", which causes periodic keepalive messages to be
    sent. When this option is used, there is no need for the WSC to perform any
    periodic operations to keep the network connection alive.
    However, if you are worried that the network might suffer a transient
    failure and you want to perform your first ATMI call after an extended
    period of inactivity as quickly as possible without waiting for another
    tpinit(), you may want to perform periodic dummy operations so that you can
    reissue the tpinit() if needed as soon as the network connection is
    restored.
    One option is to make a tpcall() to the ".TMIB" service with an FML32 buffer
    where TA_OPERATION is set to "GET" and the other fields are set to retrieve
    some system attribute. There is an example of how to call .TMIB at the end
    of the TM_MIB(5) manual page. You would want to perform a GET operation
    rather than the SET operation shown in that example.
    Another option is to write a null service in one of your application servers
    which just calls tpreturn() and have your client make periodic cals to that
    service.
    Calling a verb such as tpalloc() or tpconvert() would not be sufficient,
    since these calls do not result in any network traffic.
    2. The tperrordetail() function is available in newer releases of Tuxedo to
    provide additional information about certain Tuxedo errors. When a
    workstation client is disconnected, tperrordetail(0) will return TPED_TERM.
    3. If there is a network failure, workstation clients must call tpinit() to
    reauthenticate to the system. This is necessary for security reasons.
    4. The keepalive option is passed down to the underlying network provider
    and Tuxedo has no further involvement with keepalive once it informs the
    network of this option. For Sockets the option passed is SO_KEEPALIVE; you
    can do a web search on SO_KEEPALIVE to see exactly how the network treats
    keepalive messages on your particular platform.
    Ed
    <Cacho Nakamura> wrote in message news:[email protected]...
    Dear all,
    I intend to automatically detect network failures from my workstation client
    and have it attempt to reconnect to the server on its own.
    Browsing the documentation for related information I saw the keep-alive
    option. If I understood correctly you can have the workstation generate
    periodic keep-alive messages to the server and if these are not
    acknowledged, all subsequent ATMI calls will fail with TPESYSTEM.
    My doubts regarding this are the following:
    1) Is there some dummy ATMI function I can invoke periodically to check for
    a disconnection? Otherwise network failures might go by unnoticed if there
    are periods where my WSC doesn't require to communicate with the server.
    2) Once I get a TPESYSTEM failure, is there some way to programatically
    discriminate if the cause is a network disconnection? It is a pretty generic
    error after all.
    3) Once all ATMI functions start failing due to keep-alive detecting a
    network failure, can the system recover on its own? or must I reconnect to
    the server? What I mean is, maybe some keep alive messages where lost, the
    system passes to the 'disconnected' state, but then the K.A. messages keep
    being generated and upon correct acknowledgement of these, subsequent ATMI
    calls will stop failing.
    4) Does the WSC go to 'disconnected' state after the first unanswered keep
    alive message? or is there some sort of tolerance like, say, 'If N messages
    in a row are not answered then assume the connection to be dead'.
    I'm sorry if it was too long a post, but neither searching the documentation
    nor this forum clarified any of these issues for me.
    Many thanks for your attention.
    Regards.

Maybe you are looking for