Socket TCP detecting disconnections

I want to take my decision-making if it gets disconnected forcefully, or loses the connection, I read everything I could find on this I have tried different methods but do not find a good, so I decided to ask my question here


main loop
            try {
                _socket = TimeoutSocket.getSocket(ip, port, timeout); //customt thing that times out after given interval
                in = _socket.getInputStream();
                out = _socket.getOutputStream();
                Socket_Connected(); //Custom event
                while (_socket.isConnected() && loop) {
                    if (close) {
                        out.close();
                        in.close();
                        _socket.close();
                        return;
                    }
                    Integer Length = in.available();
                    byte[] data = new byte[Length];
                    in.read(data, 0, Length);
                    if (data.length > 0) {
                        if (Socket_Receive.getListenerCount() > 0)  {
                            Socket_Receive(data); //Custom event
                        }
                    }
                    Thread.sleep(100);
                }
            } catch (Exception e) {
                e.printStackTrace();
            }
            Socket_Disconnected(); //Custom event
Send function
    public Boolean Send(byte[] data)
    {
        try {
            out.write(data);
            out.flush();
            return true;
        } catch (Exception e) {
            e.printStackTrace();
        }
        return false;
    }
Published by: Tuck on 2010-11-06 18:29 - fixed tabs to spaces

1. I guess that TimeoutSocket.getSocket (ip, port and timeout) do something like:

Socket s = new Socket(ip, port);
s.setSoTimeout(timeout);
return s;

Fine.

2. no idea what Socket_Connected(). I guess that it performs no operation socket, name is just something to tell him that the plug is connected. Fine.

3 Thread.sleep (100) does nothing useful, just slows you down.

4. you should put the read() in a try-catch block (SocketTimeoutException) and in the screenshot, that you should continue in a loop.

5. your last catch (Exception) should also close the socket.

You detect many disconnect this way, but perhaps not all conditions (disconnection of the cable is a prime candidate to go unnoticed).
The only reliable method to find out of disconnection is to write() on the plug (it is a quote from the EJP in an old thread. I check).
If the Protocol allows that you and you want to be 100% sure, do it periodically (in SocketTimeoutException Manager).
Send some kind of small NOOP for the package, which will not take the server as any other thing.

Tags: Java

Similar Questions

  • Allowing my goal (cRIO) detect disconnection of LAN with host

    Dears

    I develop a standalone application using sbRIO (with RT VI and VI FPGA) and logging data to a host (Host VI) PC...

    the fact is that I need my RT goal to detect if a LAN disconnect has occurred (for example the host pc crashed), he should do a collection of certain data until the connection to the local network is retrieved...

    I don't know if there is something similar to ping between the RT and the host which is done periodically to check the connectivity?

    Help!

    Thanks in advance

    Why not sent a message of "pulse" every second. In this way, if the heart rate does not occur after a certain period, the collection of local data may occur.  Other messages can be sent to recover local data and restore the streaming data.

  • Detect disconnect NetStream

    Hello

    When two instances of Flash Player are directly connected via NetStream, is there a way to know when the other has disconnected (for example, by closing her browser)? I see nothing in NetStatusEvent.info.

    Thank you

    Rob

    You should get a NetStream.Connect.Closed sent to the event of the NetConnection instance listener.  Event.info.Stream will be the flow of specific peer.

  • TCP/IP visa write stop character

    Dear all,

    I did an application with LabView where I communicate to my instrument via RS232. I use the VISA command.

    This application works OK.

    Now, here's my problem, my instrument also have an ethernet interface, so I want to be able to communicate using TCP/IP socket.

    The problem is that I have not found in the properties of socket TCP/IP, an equivalent to the 'Mode' end for the Scriptures of the serial property.

    If I want my instrument understand that I send, I need to add a 0x0A character to the string sent. When I use the RS232 interface, this is done by "mode of end for the Scriptures.

    I would like to avoid manually adding a 0x0A when I connect by Ethernet in my entire program because it is quiet big.

    You have an idea?

    Thanks a lot for your help.

    Best regards

    The 'end' is defined in 488.2 as EOI which is actually one of the lines of control. This is why the help information are a little confusing for me. I know that with GPIB functions you can optionally add a LF or CR to the IDE and it is also something that can be set in MAX when you configure a GPIB card. According to me, the default value is not character and I looked for a VISA property that would do something similar, but did not find anything specific to change the character of 488 end. I was hoping that the stop character was the same thing but I don't think. I hope that someone with a deeper insight into the VISA will respond.

  • Socket RAW InputStream.availalble () in stream wireless network always 0?

    For all BlackBerry networking expert out there.

    The explanation of the problem will be quite long, so I'll try to structure the message to facilitate navigation.

    Introduction

    Recently, we went from HttpConnection to raw sockets in our application.  It wasn't an easy decision (a lot of extra code had to be written and debugged) - it stemmed from the fact that on different devices HttpConnection behaves very differently and sometimes we would just hang out here for always trying to read something, although enough bytes was available in the buffers of the system (I have seen it with my own eyes; can develop if anyone is interested).  There are other reasons, but this has been the main.

    Previously working solution

    Once we went to the outlets and implemented our own HttpConnection (not me - someone to increase their knowledge in networks of BB did this), our problems have disappeared. In order to reduce the chance of getting stuck forever, we check InputStream.available () of the socket and, if there is always a thread. Sleep() 0, for some small interval (makes me cringe, but well, the user makes a call blocking!) then read just one byte (hoping that there might be something).  It worked for all trackball/touchcpad devices and all kinds of connections (SDM is a separate issue, but we managed)...

    New problem

    ... until we have tested the Storm (5.0 Storm1 and Storm2 - both 5.0 behaved similarly) with all, but connections WiFi disabled.  We have connected WiFi router to the company (I then repeated the test at home with my wireless router and got the same results).  BB browser worked fine.  However, our code began fails on our internal waiting time.  When I connected the phone to the debugger and set up breakpoints, I quickly discovered that InputStream.available () always zero returns! I'm not kidding!

    Our code was constantly diverted waiting, waiting, reading another byte, read a byte...  Even when I changed the way that we on the download time was exceptionally slow (as in "unbearable").

    Worse still - when I tried to wait before making the first longer interval (100ms) read, followed by reading the characters one by one without waiting, the phone started rebooting randomly!

    Request

    Someone has seen something similar?  If so, what was your approach?  I won't sit idly while waiting the answers here - I have a few ideas to try-, but if anyone has been there, it would be nice if you can just push me in the right direction.

    Thanks in advance,

    Arkady.

    Other people have had problems with available().  I'm surprised that you managed to get that you have to be honest, I thought he always returned 0.

    We make socket connections, and always the transmission with a header field that contains prefix length.  So read on the Blackberry is basically

    (a) header to read

    (b) reading of data

    (c) to process the data

    (d) proceed to (a).

    Another user and I had problems recently with http and OS 5.0 using WiFi connections - circuit up to and/or time out when reading the response.  This is the thread

    http://supportforums.BlackBerry.com/T5/Java-development/network-IO-hang-on-OS5/m-p/541487

    I would recommend you change your implementation of socket and detection of data along these kinds of lines, in other words, how data should be read and set up some kind of detection/stall.

    Does make sense?

  • How to connect through the connection Socket BIS?

    Hi all, I am trying to connect to Socket BIS. I'm able to establish BIS my service provider Http connection. I downloaded a chat application that checks the types of networks supported by my device/package that has the following list:

    (1) BIS-Http: OK

    (2) BIS-SOCKET: OK

    (3) BES-HTTP: NA

    BES-SOCKET 4): NA

    (5) TCP-HTTP: BAD DNS

    (SOCKET TCP-6): EXPIRED

    I know direct TCP is not supported by my ISP. So I would use BIS-Socket connection. Can anypne please help me reach this type of connectivity? Help, please. Thanks in advance.

    as a member of the alliance, you can apply to BIS-B access with an application. you get your own connection key that you can use to create connections of bis - b.

  • Win7 client TCP send RST/ACK

    Win-7 TCP sends [RST/ACK] after ~ 90 sec of traffic all the time. Reproducible 100% on several PC Win - 7.

    Same TCP App on Win - XP works fine.  Socket TCP in both cases connected to one machine Linux Ubuntu.

    Any suggestions how debug layer TCP?

    At soon kes

    Hi kestasj,

    You can find the information in this document useful to determine if raw sockets are supported.

    If additional assistance is needed with the TCP app, post your question in the Peer-to-Peer Networking for Windows Desktop Forum.

  • Control packets on the Socket API

    This sounds like a strange question.

    I have an application that connects to a banking service ISO using Java Sockets, TCP/IP. The application is ready, but we have had delays in receiving messages. The Bank says they must receive each message in a single TCP/IP packet. Now who doesn't make sense for me because I can't control how TCP/IP sends out packets through the network. In the Socket API I see not all methods to control this with the exception of TcpDelay. So is just a question, there a way to control how packets are sent to the network?

    Kind regards

    Nestor Boscan

    No, you can't control with the socket API like everything which is abstracted away (thank God!). IMO the requirement itself seems counterproductive to limit and at least error prone if you ask me.

    Maybe the NIO package provides more precise control, but I don't remember having read about it. If anything I would look into the NIO of Java 7 features.

  • Need help for some objects Flash weird error... Please!

    I have a bit of a problem to my page in Dreamweaver CS4, I don't know why I can't see my flash animations in internet explorer, but in another browser I can do! My page is www.jmelectric.com.mx and the error I have her:

    Webpage error details

    User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; WOW64; Trident/4.0; SLCC1; .NET CLR 2.0.50727; Media Center PC 5.0; InfoPath.2; .NET CLR 3.5.30729; .NET CLR 3.0.30618)
    Timestamp: Tuesday, December 29, 2009 22:12:48 UTC


    Message: Object doesn't support this property or method
    Online: 452
    Char: 19
    Code: 0
    URI: http://www.jmelectric.com.mx/Scripts/swfobject_modified.js

    and the code of this JS code is...

    /*! SWFObject v2.0 <http://code.google.com/p/swfobject/>
    Copyright (c) 2007 Geoff Stearns, Michael Williams, and Bobby van der Sluis
    This software is distributed under the license MIT <http://www.opensource.org/licenses/mit-license.php>
    */

    SWFObject var = function() {}

    var UNDEF = "undefined."
    OBJECT ="object", ".
    SHOCKWAVE_FLASH = "Shockwave Flash",
    SHOCKWAVE_FLASH_AX = "ShockwaveFlash.ShockwaveFlash."
    FLASH_MIME_TYPE = application/x-shockwave-flash"."
    EXPRESS_INSTALL_ID = "SWFObjectExprInst"

    Win: a window,
    doc = document,
    NAV = navigator,

    domLoadFnArr = [],
    regObjArr = [],
    Timer = null,
    storedAltContent = null,
    storedAltContentId = null,
    isDomLoaded = false,
    isExpressInstallActive = false;

    / * Centralized function for browser detection
    -Owners (conditional compilation) detection is used to detect features of Internet Explorer
    -Detection of string user agent is used only when no alternative is possible
    -Is executed directly for optimal performance
    */
    var ua = function() {}
    var w3cdom = typeof doc.getElementById! = UNDEF & & typeof doc.getElementsByTagName! = UNDEF & & typeof doc.createElement! = UNDEF & & typeof doc.appendChild! = UNDEF & & typeof doc.replaceChild! = UNDEF & & typeof doc.removeChild! = UNDEF & & typeof doc.cloneNode! = UNDEF,
    playerVersion = [0,0,0],
    d = null;
    If (typeof nav.plugins! = UNDEF & & typeof nav.plugins [SHOCKWAVE_FLASH] == OBJECT) {}
    d = nav.plugins [SHOCKWAVE_FLASH] .description;
    If (d) {}
    (d = d.replace(/^.*\s+(\S+\s+\S+$) /, '$1');
    playerVersion [0] = parseInt (d (/ ^(.*)------... * $/, "$1"), 10);
    playerVersion [1] = parseInt (d (/ ^. * \.)) (. *)\s.*$/, "$1"), 10);
    playerVersion [2] = /r/.test(d)? parseInt(d.replace(/^.*r(.*)$ /, '$1'), 10): 0;
    }
    }
    else if (typeof win. ActiveXObject! = UNDEF) {}
    var a = null, fp6Crash = false;
    try {}
    a = new ActiveXObject (SHOCKWAVE_FLASH_AX + ".") 7") ;
    }
    {catch (e)}
    try {}
    a = new ActiveXObject (SHOCKWAVE_FLASH_AX + ".") 6 ») ;
    playerVersion = [6,0,21];
    a.AllowScriptAccess = "always";  Introduced in fp6.0.47
    }
    {catch (e)}
    If (playerVersion [0] == 6) {}
    fp6Crash = true;
    }
    }
    If (! fp6Crash) {}
    try {}
    a = new ActiveXObject (SHOCKWAVE_FLASH_AX);
    }
    {catch (e)}
    }
    }
    If (! fp6Crash & & a) {/ / a will return NULL when ActiveX is disabled}
    try {}
    d = a.GetVariable ("$version");  Crash fp6.0.21/23/29
    If (d) {}
    d = d.split("") [1].split(",");
    playerVersion = [parseInt (d [0], 10), parseInt (d [1], 10), parseInt (d [2], 10)];
    }
    }
    {catch (e)}
    }
    }
    var u = nav.userAgent.toLowerCase (),
    p = nav.platform.toLowerCase (),
    WebKit = /webkit/.test(u)? ((parseFloat(u.replace(/^.*webkit\/(\d+(\.\d+)?). * $/, '$1')): false, / / returns the version of webkit or false otherwise webkit
    IE = false,
    Windows = p? (/Win/.test(p): /win/.test(u).
    Mac = p? (/Mac/.test(p): /mac/.test(u);
    /*@cc_on
    IE = true;
    @if (@_win32)
    Windows = true;
    @elif (@_mac)
    Mac = true;
    @end
    @*/
    return {w3cdom:w3cdom, pv:playerVersion, webkit:webkit, IE: IE, win: windows, mac: mac};
    }();

    / * OnDomLoad Cross-browser
    -Based on the solution of Dean Edwards: http://dean.edwards.name/weblog/2006/06/again/
    -Triggers an event as soon as the DOM of a page is loaded (supported by browsers based on Gecko based - like Firefox - IE, Opera9 +, Safari)
    */
    var onDomLoad = function() {}
    If (! ua.w3cdom) {}
    return;
    }
    addDomLoadEvent (hand);
    If (ua.ie & & ua.win) {}
    try {/ / avoid a possible abandoned operation error}
    doc. Write ("< scr" + "ipt id = __ie_ondomload reporter = true src = / /: > < / scr" + "ipt >"); String is split into pieces to prevent Norton AV to add code that can lead to errors
    var s = getElementById ("__ie_ondomload");
    If (s) {}
    s.onreadystatechange = function() {}
    If (this.readyState == 'complete') {}
    this.parentNode.removeChild (this);
    callDomLoadFunctions();
    }
    };
    }
    }
    {catch (e)}
    }
    If (ua.webkit & & typeof doc.readyState! = UNDEF) {}
    Timer = setInterval (function () {if (/ loaded|complete/.test(doc.readyState)}) {callDomLoadFunctions() ;}}, 10);
    }
    If (typeof doc.addEventListener! = UNDEF) {}
    doc.addEventListener ("DOMContentLoaded", callDomLoadFunctions, null);
    }
    addLoadEvent (callDomLoadFunctions);
    }();

    function callDomLoadFunctions() {}
    If {(isDomLoaded)
    return;
    }
    If (ua.ie & & ua.win) {/ / check if we can really add to the DOM model; we do not want the fire too soon}
    var s = createElement ('span');
    try {/ / avoid a possible abandoned operation error}
    var t = doc.getElementsByTagName ("body") [0] .appendChild (s);
    t.parentNode.removeChild (t);
    }
    {} catch (e)
    return;
    }
    }
    isDomLoaded = true;
    If {(timer)
    clearInterval (timer);
    Timer = null;
    }
    DL var = domLoadFnArr.length;
    for (var i = 0; i < dl; i ++) {}
    domLoadFnArr [i] ();
    }
    }

    function addDomLoadEvent (fn) {}
    If {(isDomLoaded)
    FN();
    }
    else {}
    domLoadFnArr [domLoadFnArr.length] = fn; Array.push () is only available in Internet Explorer 5.5 +.
    }
    }

    / * Cross-browser onload
    -Based on the solution of James Edwards: http://brothercake.com/site/resources/scripts/onload/
    -Triggers an event as soon as a web page, including all of its assets are loaded
    */
    function addLoadEvent (fn) {}
    If (typeof win.addEventListener! = UNDEF) {}
    win.addEventListener ("load", fn, false);
    }
    else if (typeof doc.addEventListener! = UNDEF) {}
    doc.addEventListener ("load", fn, false);
    }
    else if (typeof win.attachEvent! = UNDEF) {}
    win.attachEvent ("onload", fn);
    }
    else if (typeof win.onload == 'function') {}
    var fnOld = win.onload;
    Win.OnLoad = function() {}
    fnOld();
    FN();
    };
    }
    else {}
    Win.OnLoad = fn;
    }
    }

    / * Main function
    -Will preferably run onDomLoad, onload otherwise (as a backup)
    */
    int main() {/ / static publishing only}
    RL var = regObjArr.length;
    for (var i = 0; i < rl; i ++) {/ / for each element of the registered object}
    var id = user.user regObjArr [i];
    If (ua.pv [0] > 0) {}
    var obj = getElementById (id);
    If (obj) {}
    regObjArr [i] .width = obj.getAttribute ("width")? obj.getAttribute ("width"): "0";
    regObjArr [i] = obj.getAttribute ("height") .height? obj.getAttribute ("height"): "0";
    If (hasPlayerVersion (regObjArr [i], .swfVersion)) {/ / Flash plugin version > = version of Flash content: Houston, we have a match!}
    If (ua.webkit & & ua.webkit < 312) {/ / older webkit engines ignore elements nested in the element of the object param}
    fixParams (obj);
    }
    setVisibility (id, true);
    }
    ElseIf (regObjArr [i] .expressInstall & &! isExpressInstallActive & & hasPlayerVersion ("6.0.65") & & (ua.win | ua.mac)) {/ / display the Adobe quick installation dialog box if defined by the author of the page web and if supported (fp6.0.65 + on Win/Mac OS only)}
    showExpressInstall (regObjArr [i]);
    }
    else {/ / invalid plugin Flash and Flash version content: display the alternative content instead of Flash content}
    displayAltContent (obj);
    }
    }
    }
    else {/ / if no fp is installed, we let the object element do its work (show alternative content)}
    setVisibility (id, true);
    }
    }
    }

    / * Difficulty nested, param elements that are ignored by older webkit engines
    -This includes Safari until and including version 1.2.2 on Mac OS 10.3
    -Fall back to the property include element
    */
    function fixParams (obj) {}
    var nestedObj = obj.getElementsByTagName (OBJECT) [0];
    If {(nestedObj)
    e var is createElement ("embed"), a = nestedObj.attributes;.
    If (a) {}
    var al is. Length;
    for (var i = 0; i < al; i ++) {}
    If (a [i].nodeName.toLowerCase () == 'data') {}
    e.setAttribute ("src", a [i] .nodeValue);
    }
    else {}
    e.setAttribute (a [i] .nodeName, a [i] .nodeValue);
    }
    }
    }
    var c = nestedObj.childNodes;
    If {(c)
    CL var = c.length;
    for (var j = 0; j < cl; j ++) {}
    If (c [j] .nodeType == 1 & & c [j].nodeName.toLowerCase () == 'param') {}
    e.setAttribute (c [j] .getAttribute ("name"), c [j] .getAttribute ("value"));
    }
    }
    }
    obj.parentNode.replaceChild (e, obj);
    }
    }

    / * Difficulty suspended discussions audio/video and force open sockets and NetConnections disconnect
    -Occurs when unloading a web page in Internet Explorer using FP8 + and innerHTML/outerHTML
    -Dynamics of publication only
    */
    function fixObjectLeaks (id) {}
    If (ua.ie & & ua.win & & hasPlayerVersion ("8.0.0")) {}
    win.attachEvent ("onunload", function () {}
    var obj = getElementById (id);
    If (obj) {}
    for (var i in obj) {}
    If (typeof obj [i] == 'function') {}
    obj [i] = function() {};
    }
    }
    obj.parentNode.removeChild (obj);
    }
    });
    }
    }

    / * Display the Adobe quick installation dialog box
    -Reference: http://www.adobe.com/cfusion/knowledgebase/index.cfm?id=6a253b75
    */
    function showExpressInstall (regObj) {}
    isExpressInstallActive = true;
    var obj = getElementById (regObj.id);
    If (obj) {}
    If {(regObj.altContentId)
    var ac = getElementById (regObj.altContentId);
    If {(ac)
    storedAltContent = ac;
    storedAltContentId = regObj.altContentId;
    }
    }
    else {}
    storedAltContent = abstractAltContent (obj);
    }
    If (!) () / %$/.test(regObj.width)) & & parseInt (regObj.width, 10) < 310) {}
    regObj.width = "310";
    }
    If (!) () / %$/.test(regObj.height)) & & parseInt (regObj.height, 10) < 137) {}
    regObj.height = "137";
    }
    doc.title = doc.title.slice (0, 47) + "-Flash Player Installation";
    var pt = ua.ie & & ua.win? "ActiveX": "PlugIn."
    DT = doc.title,
    FV = "MMredirectURL =" + win.location + "& MMplayerType =" + pt + "& MMdoctitle =" + dt.
    replaceId = regObj.id;
    For IE when a SWF file is loading (AND: not available in the cache) wait for the onload event to remove the original object element
    In IE you can not properly cancel a loading SWF file without breaking the browser load references, also does not work obj.onreadystatechange
    If (ua.ie & & ua.win & & obj.readyState! = 4) {}
    var newObj = createElement ("div");
    replaceId += "SWFObjectNew";
    newObj.setAttribute ("id", replaceId);
    obj.parentNode.insertBefore (newObj, obj); Insert the placeholder div will be replaced by the object element that loads expressinstall.swf
    obj.style.display = 'none ';
    win.attachEvent ("onload", function() {obj.parentNode.removeChild (obj) ;});
    }
    createSWF ({data: regObj.expressInstall id: EXPRESS_INSTALL_ID, width:regObj.width, height:regObj.height}, {flashvars:fv}, replaceId);
    }
    }

    / * Functions of abstraction and display alternative content
    */
    function displayAltContent (obj) {}
    If (ua.ie & & ua.win & & obj.readyState! = 4) {}
    For IE when a SWF file is loading (AND: not available in the cache) wait for the onload event to remove the original object element
    In IE you can not properly cancel a loading SWF file without breaking the browser load references, also does not work obj.onreadystatechange
    var El = createElement ("div");
    obj.parentNode.insertBefore (el, obj); Insert the placeholder div will be replaced by alternative content
    el.parentNode.replaceChild (abstractAltContent (obj), el);
    obj.style.display = 'none ';
    win.attachEvent ("onload", function() {obj.parentNode.removeChild (obj) ;});
    }
    else {}
    obj.parentNode.replaceChild (abstractAltContent (obj), obj);
    }
    }

    function abstractAltContent (obj) {}
    var ac = createElement ("div");
    If (ua.win & & ua.ie) {}
    ac.innerHTML = obj.innerHTML;
    }
    else {}
    var nestedObj = obj.getElementsByTagName (OBJECT) [0];
    If {(nestedObj)
    var c = nestedObj.childNodes;
    If {(c)
    CL var = c.length;
    for (var i = 0; i < cl; i ++) {}
    If (!) () c [i] .nodeType == 1 & & c [i].nodeName.toLowerCase () == 'param') & &! (c [i] .nodeType is 8)) {
    ac.appendChild (c [i] .cloneNode (true));
    }
    }
    }
    }
    }
    return ac;
    }

    / * Creation of dynamic Cross-browser SWF
    */
    function createSWF (attObj, parObj, id) {}
    var r, el is getElementById (id);
    If (typeof attObj.id == UNDEF) {/ / If no 'id' is defined for the object element, it will inherit the 'id' of alternative content}
    attObj.id = id;
    }
    If (ua.ie & & ua.win) {/ / do not combine the IE, the purpose and methods of the W3C DOM element: return to outerHTML}
    att var = "";
    for (var i in attObj) {}
    If (attObj [i]! = Object.prototype [i]) {/ / filter out other potential libraries prototype additions, like Object.prototype.toJSONString = function() {}
    If (I == 'data') {}
    parObj.movie = attObj [i];
    }
    ElseIf (i.toLowerCase () == "styleclass") {/ / 'class' is an ECMA4 reserved keyword}
    att += "class =" "+ attObj [i] ' + '" '; "
    }
    Else if (I! = "classid") {}
    att += ' ' + i + "=" "+ attObj [i] ' + '" '; "
    }
    }
    }
    by var = "";
    for {(var j in parObj)
    If (parObj [j]! = Object.prototype [j]) {/ / filter additions of other potential libraries prototype}
    "by += ' < param name =" "' + j + '" value = "" + parObj [j] + "" / > ';
    }
    }
    el.outerHTML = ' < object classid = "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" ' + att + ' > ' + by + ' < / object > ";
    fixObjectLeaks (attObj.id); This bug only affects dynamic publishing
    r = getElementById (attObj.id);
    }
    ElseIf (ua.webkit & & ua.webkit < 312) {/ / older webkit engines ignore elements nested in the element of the object param: fall to property incorporate element}
    var e = createElement ("embed");
    e.setAttribute ("type", FLASH_MIME_TYPE);
    for (var attObj k) {}
    If (attObj [k]! = Object.prototype [k]) {/ / filter additions of other potential libraries prototype}
    If (k == 'data') {}
    e.setAttribute ("src", attObj [k]);
    }
    ElseIf (k.toLowerCase () == "styleclass") {/ / 'class' is an ECMA4 reserved keyword}
    e.setAttribute ("class", attObj [k]);
    }
    ElseIf (k! = "classid") {/ / filter the specific attribute IE}
    e.setAttribute (k, attObj [k]);
    }
    }
    }
    for {(var l parObj)
    If (parObj [l]! = Object.prototype [l]) {/ / filter additions of other potential libraries prototype}
    If (l! = 'movie') {/ / filter the IE specific param elements}
    e.setAttribute (l, parObj [t]);
    }
    }
    }
    el.parentNode.replaceChild (e, el);
    r = e;
    }
    else {/ / good browsers behave}
    var o = createElement (OBJECT);
    o.setAttribute ("type", FLASH_MIME_TYPE);
    for {(var m in attObj)
    If (attObj [m]! = Object.prototype [m]) {/ / filter additions of other potential libraries prototype}
    If (m.toLowerCase () == "styleclass") {/ / 'class' is an ECMA4 reserved keyword}
    o.setAttribute ('class', attObj [m]);
    }
    Else if (m! = "classid") {/ / filter the specific attribute IE}
    o.setAttribute (m, attObj [m]);
    }
    }
    }
    for {(var n in parObj)
    If (parObj [n]! = Object.prototype [n] & & n! = 'movie') {/ / filter additions of other potential libraries prototype and the IE specific param element}
    createObjParam (o, n, parObj [n]);
    }
    }
    el.parentNode.replaceChild (o, el);
    r = o;
    }
    Return r;
    }

    function createObjParam (el, pName, pValue) {}
    var p = createElement ("param");
    p.setAttribute ("name", pName);
    p.setAttribute ("value", pValue);
    el.appendChild (p);
    }

    function getElementById (id) {}
    Return doc.getElementById (id);
    }

    function createElement (el) {}
    Doc.createElement (el) return;
    }

    function hasPlayerVersion (rv) {}
    var pv = ua.pv, v is rv.split(".");.
    v [0] = parseInt (v [0], 10);
    v [1] = parseInt (v [1], 10);
    v [2] = parseInt (v [2], 10);
    return (pv [0] > v [0] |) (pv [0] == v [0] & & pv [1] > v [1]) | (pv [0] == v [0] & & pv [1] == v [1] & & pv [2] > = v[2])) ? true: false;
    }

    / * Creation of dynamic Cross-browser CSS
    -Based on the solution of Bobby van der Sluis: http://www.bobbyvandersluis.com/articles/dynamicCSS.php
    */
    function createCSS (salt, VAT statement) {}
    If (ua.ie & & ua.mac) {}
    return;
    }
    var h = doc.getElementsByTagName ("head") [0], s = createElement ("style");
    s.setAttribute ("type", "text/css");
    s.setAttribute ("media", "screen");
    If (!) () UA.ie & & ua.win) & & typeof doc.createTextNode! = UNDEF) {}
    s.appendChild (doc.createTextNode (salt + "{" + VAT statement + "}"));
    }
    h.appendChild (s);
    If (ua.ie & & ua.win & & typeof doc.styleSheets! = UNDEF & & doc.styleSheets.length > 0) {}
    ls = doc.styleSheets var [doc.styleSheets.length - 1];
    If (typeof ls.addRule == OBJECT) {}
    ls.addRule (salt, VAT statement);
    }
    }
    }

    function setVisibility (id, isVisible) {}
    var v = isVisible? "visible": "hidden";
    If {(isDomLoaded)
    getElementById (id).style.visibility = v;
    }
    else {}
    createCSS ("#" + id, "visibility:" + v);
    }
    }

    function getTargetVersion (obj) {}
    If (! obj)
    return 0;
    var c = obj.childNodes;
    CL var = c.length;
    for (var i = 0; i < cl; i ++) {}
    If (c [i] .nodeType == 1 & & c [i].nodeName.toLowerCase () ==' object ' ') {}
    c = c [i] Sublst.ChildNodes(1).ChildNodes(0);
    cl = c.length;
    i = 0;
    }
    If (c [i] .nodeType == 1 & & c [i].nodeName.toLowerCase () == 'param' & & c [i] .getAttribute ("name") == 'swfversion') {}
    Return c [i] .getAttribute ("value");
    }
    }
    return 0;
    }

    function getExpressInstall (obj) {}
    If (! obj)
    Return ' ';
    var c = obj.childNodes;
    CL var = c.length;
    for (var i = 0; i < cl; i ++) {}
    If (c [i] .nodeType == 1 & & c [i].nodeName.toLowerCase () ==' object ' ') {}
    c = c [i] Sublst.ChildNodes(1).ChildNodes(0);
    cl = c.length;
    i = 0;
    }
    If (c [i] .nodeType == 1 & & c [i].nodeName.toLowerCase () == 'param' & & c [i] .getAttribute ("name") == "expressinstall") {}
    Return c [i] .getAttribute ("value");
    }
    }
    Return ' ';
    }

    return {}
    / * Public API
    -Reference: http://code.google.com/p/swfobject/wiki/SWFObject_2_0_documentation
    */
    registerObject: {function (objectIdStr, swfVersionStr, xiSwfUrlStr)
    If (! ua.w3cdom:! objectIdStr) {}
    return;
    }
    var obj = document.getElementById (objectIdStr);
    XI var = getExpressInstall (obj);
    var regObj = {};
    regObj.id = objectIdStr;
    regObj.swfVersion = swfVersionStr? swfVersionStr: getTargetVersion (obj);
    regObj.expressInstall = xiSwfUrlStr? xiSwfUrlStr: ((xi! = "")?) XI: false);
    regObjArr [regObjArr.length] = regObj;
    setVisibility (objectIdStr, false);
    },

    getObjectById: {function (objectIdStr)}
    var r = null;
    If (ua.w3cdom & & isDomLoaded) {}
    var o = getElementById (objectIdStr);
    If (o) {}
    var n = o.getElementsByTagName (OBJECT) [0];
    If (! n |) (n & & typeof o.SetVariable! = UNDEF)) {
    r = o;
    }
    else if (typeof n.SetVariable! = UNDEF) {}
    r = n;
    }
    }
    }
    Return r;
    },

    embedSWF: function (swfUrlStr, replaceElemIdStr, widthStr, heightStr, swfVersionStr, xiSwfUrlStr, flashvarsObj, parObj, attObj) {}
    If (! ua.w3cdom:! swfUrlStr |! replaceElemIdStr |! widthStr:! heightStr |! swfVersionStr) {}
    return;
    }
    widthStr += ""; Automatic conversion of string to be stupid
    heightStr += "";
    If (hasPlayerVersion (swfVersionStr)) {}
    setVisibility (replaceElemIdStr, false);
    var att = (typeof attObj == OBJECT)? attObj: {};
    att. Data = swfUrlStr;
    att. Width = widthStr;
    att. Height = heightStr;
    by var = (typeof parObj is OBJECT)? parObj: {};
    If (typeof flashvarsObj == OBJECT) {}
    for (var i in flashvarsObj) {}
    If (flashvarsObj [i]! = Object.prototype [i]) {/ / filter additions of other potential libraries prototype}
    If (typeof par.flashvars! = UNDEF) {}
    by. FlashVars += "&" + i + "=" + flashvarsObj [i];
    }
    else {}
    by. FlashVars = i + "=" + flashvarsObj [i];
    }
    }
    }
    }
    {addDomLoadEvent (function ()}
    createSWF (att, par, replaceElemIdStr);
    If (att.id == replaceElemIdStr) {}
    setVisibility (replaceElemIdStr, true);
    }
    });
    }
    ElseIf (xiSwfUrlStr & &! isExpressInstallActive & & hasPlayerVersion ("6.0.65") & & (ua.win | ua.mac)) {}
    setVisibility (replaceElemIdStr, false);
    {addDomLoadEvent (function ()}
    var regObj = {};
    regObj.id = regObj.altContentId = replaceElemIdStr;
    regObj.width = widthStr;
    regObj.height = heightStr;
    regObj.expressInstall = xiSwfUrlStr;
    showExpressInstall (regObj);
    });
    }
    },

    getFlashPlayerVersion: function() {}
    return {major: ua.pv [0], minor:ua.pv [1], release: ua.pv [2]};
    },

    hasFlashPlayerVersion:hasPlayerVersion,

    createSWF: {function (attObj, parObj, replaceElemIdStr)
    If (ua.w3cdom & & isDomLoaded) {}
    Return createSWF (attObj, parObj, replaceElemIdStr);
    }
    else {}
    return undefined;
    }
    },

    createCSS: function (salt, VAT statement) {}
    If {(ua.w3cdom)
    createCSS (salt, VAT statement);
    }
    },

    addDomLoadEvent:addDomLoadEvent,

    addLoadEvent:addLoadEvent,

    getQueryParamValue: {function (param)}
    var q = doc.location.search | doc. Location.Hash;
    If (param == null) {}
    Return to q;
    }
    {if (q)}
    var pairs = q.substring (1) .split ("&");
    for (var i = 0; i < pairs.length; i ++) {}
    If (pairs [i] .substring (0, peers [i] .indexOf ("=")) == param) {}
    peers return [i] .substring ((peers [i] .indexOf ("=") + 1));
    }
    }
    }
    Return ' ';
    },

    For internal use only
    expressInstallCallback: function() {}
    If (isExpressInstallActive & & storedAltContent) {}
    var obj = getElementById (EXPRESS_INSTALL_ID);
    If (obj) {}
    obj.parentNode.replaceChild (storedAltContent, obj);
    If {(storedAltContentId)
    setVisibility (storedAltContentId, true);
    If (ua.ie & & ua.win) {}
    storedAltContent.style.display = 'block ';
    }
    }
    storedAltContent = null;
    storedAltContentId = null;
    isExpressInstallActive = false;
    }
    }
    }

    };

    }();

    Hello

    It is a problem with the code you are using, to remove the lines marked in red and check if it works then. Or move the code of swfobjects, (6 off) above any other javascript code you have at the bottom of your page.

    
    

    PZ

  • WLS 11 g - error BEA-101019

    Hello

    Recently with this exption in one of the ports of WLS 11 g. Clues? Thanks in advance

    [[ServletContext@69507598[app:Weblogic_PD900_3 module: jde path: / jde spec-version: null]] Servlet failed with weblogic.utils.NestedRuntimeException IOException: impossible to analyse the parameters of PUBLICATION of the application: ' / jde/E1VirtualClient.mafService ' to weblogic.servlet.internal.ServletRequestImpl$ RequestParameters.mergePostParams (ServletRequestImpl.java:2144) to weblogic.servlet.internal.ServletRequestImpl$ RequestParameters.parseQueryParams (ServletRequestImpl.java:2024) to weblogic.servlet.internal.ServletRequestImpl$ RequestParameters.getQueryParams (ServletRequestImpl.java:1918) to weblogic.servlet.internal.ServletRequestImpl$ RequestParameters.getParameterNames (ServletRequestImpl.java:1953) to weblogic.servlet.internal.ServletRequestImpl$ RequestParameters.access$ 900 (ServletRequestImpl.java:1817) at weblogic.servlet.internal.ServletRequestImpl.getParameterNames(ServletRequestImpl.java:808) at weblogic.servlet.internal.ServletRequestImpl.getParameterMap(ServletRequestImpl.java:863) at com.jdedwards.base.JDEFilter.doFilter (unknown Source) at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56) at com.jdedwards.util.filters.GZIPFilter.doFilter (unknown Source) at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56) at weblogic.servlet.internal.WebAppServletContext$ (WebAppServletContext.java:3715) ServletInvocationAction.wrapRun to weblogic.servlet.internal.WebAppServletContext$ (WebAppServletContext.java:3681) ServletInvocationAction.run to weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321) to weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120) to due to weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2277) to weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2183) to weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1454) to weblogic.work.ExecuteThread.execute(ExecuteThread.java:209) to weblogic.work.ExecuteThread.run(ExecuteThread.java:178): java.net.SocketTimeoutException: Read timed out at jrockit.net.SocketNativeIO.readBytesPinned (Native Method) at jrockit.net.SocketNativeIO.socketRead(SocketNativeIO.java:46) at java.net.SocketInputStream.read(SocketInputStream.java:130) at weblogic.servlet.internal.PostInputStream.read(PostInputStream.java:177) at weblogic.servlet.internal.ServletInputStreamImpl.read(ServletInputStreamImpl.java:229) at weblogic.servlet.internal.ServletRequestImpl$ RequestParameters.getParameterNames at weblogic.servlet.internal.ServletRequestImpl.getParameterMap(ServletRequestImpl.java:863) at com.jdedwards.base.JDEFilter.doFilter (unknown Source) at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:57) at com.jdedwards.util.filters.GZIPFilter.doFilter (unknown Source) at weblogic.servlet.internal.WebAppServletContext (ServletRequestImpl.java:1953) $(WebAppServletContext.java:3681) ServletInvocationAction.run to weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321) to weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2183) to weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1454) to weblogic.work.ExecuteThread.run) ExecuteThread.java:178

    Generally happens when a socket connection is disconnected, or when it is reset by the normal application operations.

    You can try to increase the timeout message to see improvements.

    Sign in to the administration Console and the

    Click on the configuration server on

    --> Http and Protocol to define the "Post Timeout" (bones of the default value of 30 seconds)

  • Tuxedo client implementation

    We have a banking application on Tuxedo with 6000 services advertised through server of the MSSS.

    Our customers access through them through plain/sockets, TCP, without workstation components.

    To do this, we have developed a multithreaded bridge that accepts client connections and calls for theses services.

    the answer back into this Jack.

    My question is what would be the best way to call via a client native Tux Tuxedo services, considering that it could be thousands

    customers connected at the same time.

    If call us via tpcall theses services, we would have to have me 1000 active threads in this bridge and 1000 IPC queue, so it doesn't seem a good idea.

    We would like to have a configuration style wire services and the other thread reading replys, but we have not found a way to do.


    Thanks in advance.


    Dani

    Hi Dani,

    The /WS way works, it's that a /WS client connects to a listener of WSL or workstation.  The listener then hands the connection to one of the many managers WSH or workstation that continue to process applications for the client to run.  A single WSL can support several WSH process and each process WSH can manage many clients.  The WSH accepts requests from the network and immediately makes an asynchronous call to the service requested by the remote client.  So to answer your question, if there are 100 concurrent requests, they are queued on the queue or queues associated with the requested service.  So if you have a single MSSS, then all 100 applications would be enrolled in the defined MSSS.

    In addition, please note that it is recommended that a set of MSSS have a fairly limited number of servers manage, as all the inactive servers throughout the queue will be awakened to try to process a request.  So if a lot of servers in the defined queue are inactive, they'll all be awakened and one of them will actually process the request.  The rest hangs again waiting for a message.  So under a lighter load, a lot of process context switches may be incurred.  That said, if the load is light, it cannot be important.  Also, it is often a good idea to have several sets of MSSS manages a set of services to provide more capacity in the queues.

    We have customers with 50,000 or more customers using /WS without problem, so I'm sure /WS can manage your number of clients.

    Kind regards

    Todd little

    Chief Architect of Oracle Tuxedo

  • Defective VMotion

    Hello

    VMotion fails on some VMs.

    Nothing is attached with virtual machines.

    no rule of cluster.

    hosts are languishing network vmotion (migration of other virtual machines but still the last batch like 3-4 vm fails).

    Hardware checked version.

    no question pending the answers

    virtual machines fails (not all)

    Migration to host < < unknown > > failed with the error already disconnected (195887150).

    vMotion migration [-1407385077:1456916523611067] write the function failed.

    vMotion migration [-1407385077:1456916523611067] failed to send final vbuf: already disconnected

    vMotion migration [-1407385077:1456916523611067] connected socket returned: already disconnected

    my group is a mixture of 5.5 / 4.1, but all nodes have the same processor. I am in the process of upgrading of nodes to 5.5...

    Any help

    Are you facing this problem after the 5.5U3? I have a the same problem and the workaround below worked for me.

    1. SSH into the ESXi host

    2. navigate to the directory where the virtual machine is running.

    3. create the folder in the virtual machine directory called BAK - UP

    4 move the swap file (vmname.vswap) to the BAK - UP directory, ignore the vswap named vmx-vswap.

    5. the virtual machine to a different host VMotion.

    -Avinash

  • can I track a pop3 server on a system that does NOT have the client insta

    Can I track a pop3 server on a system that does NOT have the client.
    With the new serfvice on a system and specifying the name of the intellectual property of a remote control in the config file
    running pop3 system. In the config file, it asks a unsername and password. Is it necessary
    and if so what are the permissions the user must?

    > Can 3.0.3 hyperic Open Source apop monitor (which takes place
    > on 1110. I tried to use the pop3 plugin but got the
    > errors I listed to the original problem. We do not run pop3
    > but run they apop.
    > Is - can anyone help with that?

    The pop3 Checker will not work with apop.  Apop Protocol requires that we send a MD5 hash with the user name.  We can, adding this ability.  In the meantime, you can simply use the Socket TCP Checker to make sure that the port is up and listening.

    -Ryan

  • vCenter session - find origin of connection

    I have a user who cannot tell me what is logging into vCenter with his credentials.  The account will be idle for several hours.  If I kill the session, it immediately.  How can I find something more identifiable as an IP of origin of the session?  I tried http://nickapedia.com/2010/02/15/vsphere-mini-monitor-now-with-more-cowbell/ on my Win 7 x 64 desktop, but it crashes in various ways when you try to connect to my vCenter.  I know there are scripts PowerCLI to kill any idle sessions, but this 'service' will record everything right back in immediately.  Thank you.

    It is something that you can easily find using vCenter vpxd.logs. You will need to know the session key which you can query the API or use the MOB vCenter under sessionManager object. You must also change your vCenter _tempoairly_ to verbose logging, if it isn't already, by defaul in that the output of logging is configured as 'info' that only goes into detail on real customers officers which is where you will identify the IP address where it connects.

    Once you are ready, turn on detailed logging and put an end to the existing connection. Wait until it reconnects, then take the session key, in this way, you don't have to search through all your vpxd.logs you are looking for the actual connection. Search the main vpxd newspaper and you should see something of the following:

    [2010-12-21 19:27:33.115 01456 info "Libs"] [ADS] Primp account found, but not local
    [2010-12-21 19:27:33.115 01456 info "App"] User authentication error 1326. \primp.
    [2010-12-21 19:27:33.131 01456 info "App"] [Auth]: user PRIMP-IND\primp
    [2010-12-21 19:27:33.131 01456 verbose "App"] [VpxdUser] Registration session with cnxId = 49C1F429-8403-4D0D-B319-7C79C2708FF1
    [2010-12-21 19:27:33.131 01456 verbose "PropertyProvider"] RecordOp ADD: sessionList ['3B655744-E886-41AE-89AC-DFF691901A1B'], SessionManager

    You should see the user name and specifically the sessionList which is your session key. From there, you will key out of the 3rd column and in my example it's "01456" which corresponds to the actual number of thread. You will use this to identify all of the entries in your session and find all the entries, you should see something of what follows not too far from the details of the session, which should look like this:

    [2010-12-21 19:27:36.053 01456 verbose "ProxySvc Req70068"] New local SSL client (TCPStreamWin32 (socket = TCP (fd = 3592) = 172.30.0.60:443, even = 172.30.0.218:53893)
    ))

    It's the real demand and you will see 'local' that must be the IP address of your vCenter server and the 'peers' who is the real customer. In my example, I faked it by logging into the my local office CROWD and this is the IP address of my system.

    If you transfer your vpxd-journal of a Linux host, you can do something of what follows to save time searching using Windows you just define two variables VPX_LOG that is the log file itself and SESSION_ID which is the session key

    VPX_LOG is vpxd - 198.log.; SESSION_ID = 3B655744-E886-41AE-89AC-DFF691901A1B; $grep (grep "${SESSION_ID}" $VPX_LOG | awk '{print $3}') $VPX_LOG | grep counterpart

    This should hopefully help you identify the culprit

  • vCenter 4.1 upgrade perf graphic strangeness, vmhba, personalized calendar

    Late last night, that I upgraded from vCenter 4.0 to 4.1.  My hosts are 3.5 130756 (I know, old, vc, update is first before going to bed and breakfast of course)

    So now my perf cards Act strangely.  To start my disk performance graphics do not show the vmhba name, it's just a column blank.  Oh, there is a separation of color and the number of entries is OK, just no names to associate.  It's the same as I watch a host or watch a virtual machine.

    The other thing strange is that when I go in a custom time period and let set 1 hour when the graph rises, the last time the first 5 minutes are not displayed and the last 10 minutes do it either.  Now, when the graph starts on the left side it starts at a value such as 15%, or whatever.  But for the last 10 minutes, just before it stops, all values to zero.

    I think what may happened has something weird on the process I used.  I did the upgrade like me who has full on the server SQL - but rights once the upgrade was done, I went from the user for the service account that was used previously.  It was used before the upgrade without problem.  When I installed first vc4 I did all the steps as service the first time - the DBA account had granted the necessary rights for the service account to create everything but then stripped these rights down there for just the db_reader and writer roles. I went from back and gave him db_owner just to cover it all.

    This could be something crazy to the fact I'm not on vSphere 4.x yet?  It would be unfortunate if this is the case, but in this case I can live with that for this short period of time before I update the hosts.

    The only errors/warnings I get in the vpxd.log are:

    SSLStreamImpl::DoServerHandshake (000000000d687f40) SSL_accept failed. Dumping error SSL queue:

    error: 14094416:SSL routines: SSL3_READ_BYTES:sslv3 unknown alert certificate

    SSL handshake failed to flow TCPStreamWin32 (socket = TCP(fd=3880) local = 10.1.21.49:443, peer = 10.1.21.49:52611), error = Exception of SSL: error: 14094416:SSL routines: SSL3_READ_BYTES:sslv3 unknown alert certificate

    Everything else is a task to start host synchronization task end etc - of the normal stuff.

    I have the same problem, here is the response from VMware:

    The problem with the loss of some data of performance in vc 4.1 is a known issue.

    At present, there is no date for a solution, so if the customer is strongly

    According to these statistics, it should consider returning to his previous vc

    installation.

    Is the bug number: PR599953

    Paul

Maybe you are looking for