Setting TCP Read timeout value?

How do I choose a timeout value for a TCP read function?
I'm receiving data from a server at a rate which varies between 40 and 140 Hz (normally 120 Hz), there is no handshaking and at any set transmission rate it appears that the network load causes the rate to fluctuate slightly.
All I have been able to do so far is plot a frame number that is received in my data and fiddle with the buffer mode and timeout until I get the least dropouts. At 120Hz 5ms works best with a standard buffer, surprisingly 8ms is poorer.
I am using a producer consumer loop with a queue and some interpolation to make up for the loss of data. 
This is very hit and miss so I'm sure there's a proper / better way to do this!

If you are using standard mode, then the read function should return any partial data, but will report an error out.
You may want to look at the functions that you call after the TCP read. I think that the enqueue function will NOT enqueue data if there is an error in.
There is a function you can use to clear TCP timeout errors. You could use this to allow you to enqueue partial data to your consumer loop.
vi.lib\addons\internet\utils\tcputil.llb\No Time Out Error.vi
Note that it will be up to your consumer code to identify your 'frames' for proper decoding.
Now is the right time to use %^<%Y-%m-%dT%H:%M:%S%3uZ>T
If you don't hate time zones, you're not a real programmer.
"You are what you don't automate"
Inplaceness is synonymous with insidiousness

Similar Messages

  • How do I set the IFSshell timeout value?

    How do I set the IFSshell timeout value?
    I open an ifsshell and move to a directory.
    Do something. Come back in 10 minites and the shell has timed
    out. Have to logout and log back in and move to the directory
    again.
    Thanks
    -Mitch

    FYI,
    IFS.PROTOCOLSERVER.SESSION.DEFAULT.Timeout
    IFS.PROTOCOLSERVER.SessionStateTimeoutPeriod
    IFS.PROTOCOLSERVER.SessionStateTimeoutPeriod
    in cup server configuration

  • Can we set the query timeout value in a global control place?

    hi everyone,
    We use the FullTextSqlQuery class to do query stuff, but we have the query timeout issue, the query sometimes timeout, sometimes is normal.  I know there is a property from Query class called Timeout, and the default
    time is 15 seconds, but we have lots of code involving FullTextSqlQuery.
    I want to know is there a gloabal place like the web.config or regedit or somewhere to set the timeout value?
    Thanks

    Did you ever get an answer?  I'm in the same boat...the only way I can seem to not charge tax to my wholesale clients is to set "tax never applies".  But I got over 300 products...how can I do it "en mass"???
    Anybody??
    I tried creating a special tax code at 0% but that didn't do it either.
    thanks in advance,
    Scot.

  • How to set TCP connection timeout in solaris 9

    Hello All,
    I am new to solaris. While using oracle, sometimes I face tcp connection timeout.
    The timeout happens after a long delay like more than 8 min. I want to reduce the tcp connection timeout to 2 min in solaris.
    Please help me to change this setting.
    My current configuration is
    SunOS testmachine 5.9 Generic_122300-13 sun4u sparc SUNW,Sun-Fire-V440
    Thanks
    Purushoth

    There's a fair amount of tunables. Without known what is timing out (dns, lost packet...), it's hard to say what you want to tweak. The list of parameters can be seen by using ndd:
    ndd /dev/tcp \?
    or
    ndd /dev/ip \?
    and can be set by using ndd -set (see ndd(1M) ). Note that anything you set has to be reset on reboot, so you have to stick this in a script somewhere, or know what the variable translates to to stick it into /etc/system.
    -r

  • How to set the EJB timeout value??

    I made a Swing application connecting with EJB to provide some service. If I set the correct J2EE server IP, everything works fine. However, it will throw an Exception after some time, if I set an incorrect IP. I would like to ask if there is any means to set a timeout value for the Swing application that it throws an exception while it cannot connect to the server after the timeout value.

    Hi,
    Amount of time required to call an EJB on a remote server depends on, I would guess, multiple factors, like server performance, network speed, link quality, etc. I'm not sure if there is a direct way of telling the client-side code to wait for results for a limited amount of time, but in general blocking on the client side until the server results are available is not a good idea (at least not from the GUI perspective, since you would be locking the display). Either way, you could make all your EJB calls from a separate thread, and timeout that. This way your client code would have complete control of responsiveness of the server side.
    Just a thought.
    Mark

  • How to set infinite read timeout on web service call

    For JAX-WS JRF web services, I have a client that can set oracle.webservices.ClientConstants.HTTP_READ_TIMEOUT to any given value. I know that if you don't set this value, the default value is infinite. But how do I explicitly set the timeout to be infinite? Maybe 0? I will get something set up that I can experiment with, but someone might know off the top of their head. Thanks.

    Have found out that 0 is the default, which is infinite timeout.

  • OSB Business Service is not timing out on Connection/Read timeout

    I have a weird problem with my business service in OSB. I have set the read timeout value as 1 sec and Connection timeout value as 1 sec. The response from backend is taking more than 2 seconds or even 3 seconds but still my business service is not timing out..! My service is still listening to the response from backend even if it comes after 3 seconds. I expect it to timeout after 2 seconds. Any ideas?
    Business Service Configurations:
    Service Type: Any type
    Protocol: http
    Retry count : 0
    Retry Application Errors: No
    Read Timeout: 0
    Connection Timeout: 0
    HTTP Request Method: POST
    Result Caching: No
    Let me know if you need any more information. Thanks in Advance.
    Regards
    Kaleem

    AbhishekJ wrote:
    Maximum possible successful response time of the service will be less than Read TO + Connection TO.
    Alas, this is not true.
    Maximum possible response time is infinity.
    There are two reasons for that.
    1. Read timeout is not counted as time from the successful connection establishing to the current moment. It is measured as time from the last received byte to now. Imagine a backend service that sends a single byte in a data packet every 500ms. Despite you have read timeout set to 1, the receiving of 3K message will take 25 minutes, and yet your Biz service will not timeout.
    2. In HTTPS, handshake is handled by a separate library which has its own quirks. Specifically, if the key exchange is broken at particular point of handshake, the library re-establishes the connection and does it few times; in my experiements, the largest I could delay the eventual fault was about 3 minutes.
    Having said that, in the OP message the configuration is Read=0, Connect=0, so I wonder why the timeout is expected.

  • HTTP Jar Download Read Timeout

    For some reason I've been having a hard time finding the setting which controls the read timeout for JAR downloads. At the moment it looks like it will never timeout such that if I am about to download a jar and the server goes down, the read will never timeout.
    TIA

    Yeah, jar downloading will use URLConnection and HTTP by default. What is not clear to me is if you can set the read timeout value in 1.4.2 and if my presumption is correct that if one does not set a read timeout value that a client could hang on a read indefinitely. I don't have the source to any concrete subclass of HttpUrlConnection that has a settable read timeout value.

  • How to create a progress bar showing status on timeout of TCP Read function

    Is there any way of creating a progress bar showing the status of a 'TCP Read timeout' time ... ?
    I'm sending a data request to an intranet server via TCP Write, and then using TCP Read with a 2 min. timeout to receive the requested data. During this time i want to show the actual progress of the timeout in a progress bar.
    Can this be done?
    And do i have to implement some kind of multitasking to make it happen?
    TIA

    Soulstorm wrote:
    > Is there any way of creating a progress bar showing the status of a
    > 'TCP Read timeout' time ... ?
    >
    > I'm sending a data request to an intranet server via TCP Write, and
    > then using TCP Read with a 2 min. timeout to receive the requested
    > data. During this time i want to show the actual progress of the
    > timeout in a progress bar.
    > Can this be done?
    > And do i have to implement some kind of multitasking to make it
    > happen?
    It can be done and you need to do some multitasking yes, but that is
    quite easy in LabVIEW. A separate loop or subVI with loop will be
    responsible for the progress bar. Set its scale to 0 and the number of
    seconds of your timeout. In parallel to the TCP Read let this loop or VI
    execute reading the time every few
    seconds and calculating the
    difference to its start time, passing this value to the progress bar
    slider. Have an extra boolean global which aborts the loop and set this
    boolean to FALSE before starting the loop/VI and TCP Read and setting it
    to TRUE on return of the TCP Read.
    Rolf Kalbermatter
    Rolf Kalbermatter
    CIT Engineering Netherlands
    a division of Test & Measurement Solutions

  • Possible to configure per connection timeout values?

    hi,
    please, does anybody know how (or whether or not it is even possible) to configure a "PER CONNECTION" timeout on the connections - created by jndi - to an ldap server?
    my understanding is that setting the "com.sun.jndi.ldap.connect.timeout" property on the javax.naming.directory.InitialDirContext sets a _global_ timeout value for _all_ connections created/managed by that InitialDirContext (that is, with a "PER CONTEXT" scope).
    however, what i would like to do instead, is somehow configure a different timeout value for each individual connection that a InitialDirContext might know about.
    the first solution that will probably pop in your head is "connection pool". however, the app sets "java.naming.ldap.factory.socket" property to a custom socket factory class. according to the following paragraph from the jndi tutorial, that disqualifies the app from using connection pools:
    "There are a couple of environment properties that automatically disqualify a Context instance from using a pooled connection. A Context instance cannot use a pooled connection if it has its "java.naming.ldap.factory.socket" property set to a custom socket factory class, or its "java.naming.security.sasl.callback" property set to a custom callback handler class, or its "com.sun.jndi.ldap.trace.ber" property set to enable protocol tracing."
    http://java.sun.com/products/jndi/tutorial/ldap/connect/config.html
    even if we could use connection pools, we still wouldn't be able to set "per connection" timeout values. would we?
    one proposed solution is to completely rip out jndi from the app and replace it with the netscape directory sdk for java. to me, that seems like too drastic a measure though - given the project's time-constraints (the way the app was originally designed does not lend itself to a straight-forward "pop-out/drop-in" type replacement). i was hoping there would be a simpler alternative (a jndi-based configuration type solution, for example).
    any suggestions would be gratefully appreciated. thanks in advance for your replies.

    Enable the Default Host option in the AirPort Admin Utility, use the IP address you have assigned to your server.

  • Modbus TCP/IP read timeout

    The code below was taken from the NI Modbus library:
    The first TCP Read VI, reads 7 bytes as a binary string. The data string is then cast to the MBAP_Header data type.
    The MBAP header contains a length field, that is used to determine the length of the Modbus PDU (i.e. remaining part of the TCP message)
    The second TCP Read VI then gets the remaining part of the message.
    Can I set the second read timeout to 0?
    For reqular Ethernet, the maximum packet payload is 1500 bytes.
    1500 bytes is larger than any Modbus message, so I would not expect segmentation of Modbus messages.
    Is this correct?
    In general, if the application data is less than 1500 bytes (on regular Ethernet) and data is read in two parts, is it a good idea to set the second read timeout to 0.
    Is there any other reason why I should not do this?
    Thanks.
    Message Edited by sparkymark567 on 01-28-2010 03:59 AM
    Message Edited by sparkymark567 on 01-28-2010 04:01 AM

    Hey,
    The second read should not have a time out of 0.  The first read only gets the first 8 bits of data, it does not buffer the rest of the package so the second read still needs time to receive the remaining data and hence will need at least some sort of time out value. 
    On the subject of segmentation, I believe you are correct.  As long as your message doesn't excede 1492 bytes (I think the 1500 includes the overhead of the Ethernet package), it should come down in one package.  
    The best thing you can do is to try it out.  
    Kind regards,
    Dominic Walker
    Cardiff University
    Electrical and Electronic Engineering Student

  • V1.5 ORB Setting Timeout values

    Is it possible to set the timeout values used by the Java ORB?
    I can�t find any information about it�
    I know that in version 1.4.x was impossible.
    I tried this with different values, but no success�
    // transport read tcp timeout property, colon separated property
    // with syntax <initial time to wait:max read giop header time to
    // wait: max read message time to wait:backoff factor>
    properties.put( "com.sun.CORBA.transport.ORBTCPReadTimeouts", "0:0:0:0");
    orb = ORB.init(args, properties);I know the values are passed to the ORB properties (debug in eclipse), but the sockets created for the connections don�t use them�
    Can some one please tell me how?
    Ps: I know that JacORB offer this feature but I prefer continuing using the ORB offered by sun.
    Thanks in advance!

    I have had the code to do it in Java 1.4 for a couple years now. It is below with instructions. Last year I started porting to Java 5 and have been unable to find the solution until now. That is below as well.
    (I am typing this from a printed copy so bear with me)
    Java 1.4
    // to use set the system property -
    // com.sun.CORBA.connection.ORBSocketFactoryClass = Jre4SocketFactory
    import com.sun.corba.se.connection.EndPointInfo;
    import com.sun.corba.se.connection.GetEndPointInfoAgainException;
    import com.sun.corba.se.internal.iiop.DefaultSocketFactory;
    import java.io.IOException;
    import java.net.ServerSocket;
    import java.net.Socket;
    public class Jre4SocketFactory
       extends DefaultSocketFactory
       public ServerSocket createServerSocket(String type, int port)
          throws IOException
          ServerSocket result = super.createServerSocket(type, port);
          result.setSoTimeout(3000);
          return result;
       public Socket createSocket(EndPointInfo epi)
          throws IOException, GetEndPointInfoAgainException
          Socket result = super.createSocket(epi);
          result.setSoTimeout(3000);
          return result;
    Java 5
    // to use set the system properties -
    // com.sun.CORBA.transport.ORBSocketFactoryClass = Jre5SocketFactory
    // com.sun.CORBA.transport.ORBConnectionSocketType = Socket
    import com.sun.corba.se.transport.DefaultSocketFactoryImpl;
    import java.io.IOException;
    import java.net.InetSocketAddress;
    import java.net.ServerSocket;
    import java.net.Socket;
    public class Jre5SocketFactory
       extends DefaultSocketFactoryImpl
       public ServerSocket createServerSocket(String type, InetSocketAddress in)
          throws IOException
          ServerSocket result = super.createServerSocket(type, in);
          result.setSoTimeout(3000);
          return result;
       public Socket createSocket(String type, InetSocketAddress in)
          throws IOException
          Socket result = super.createSocket(type, in);
          result.setSoTimeout(3000);
          return result;
    }This is just how I did timeouts in corba. You can also implement encryption etc by using this method and wrapping up the socket. I figured out both of them by reading the source code out in com.sun.corba.se...etc. Both of the above are tested and work great in operational code.
    --Zerothbase                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • How do i set the timeout value?

    I'm doing an insert...in the insert i have a trigger that fires a http put. when i'm doing a couple inserts at a time, it works fine. However if i try to insert about 50 at one time (within msecs of each other) then i get the following error:
    ORA-29276 transfer timeout
    Cause: Timeout occurred while reading from or writing to a network connection.
    Action: Check the remote server or the network to ensure that it responds within the timeout limit. Or increase the timeout value.
    My question is, how do i set this timeout value?

    FYI,
    IFS.PROTOCOLSERVER.SESSION.DEFAULT.Timeout
    IFS.PROTOCOLSERVER.SessionStateTimeoutPeriod
    IFS.PROTOCOLSERVER.SessionStateTimeoutPeriod
    in cup server configuration

  • Setting connect timeout and read timeout on a Web service Client

    How can I set timeout values for a SOAP Web service client?
    I don't want to set timeout values for the complete JVM, but on a call-by-call basis. I was looking for something like:
      SOAPConnection c = ....
      c.setTimeout(...);Anyone?

    Thanks again fsato4, but i still can not resolve my problem. I must use the java 1.2.2 and i think the package java.nio.charset is not supported. I have read documentation about the use of encodings but i can not understand clearly what is happening in my application. Let me explain what i am thinking and ask you some things.
    I send a message from the client in VB using soap toolkit, obviously in UTF-8 format. When the message is received in my Java Web service, Do i need to do something in order to my Java string understands the message?.
    What i am doing is to obtain the byte array with the following line:
    byte[] utf8Bytes = strXmlFile.getBytes("UTF8");
    And then i use the constructor of the string as follows:
    String ostr = new String (utf8Bytes,"UTF8"); I think that in this point i have my string in a valid representation for my server (Sun solaris) Rigth?. And finally i use my new string to pass that value to my function which expects a java.lang.String, but the result is that all the special characters are replaced.
    Just after of the new String line, i write my string to an Buffered Writer pointed to a FileOutputStream (just for Doublecheck) using the "ISO8859_1" encoding and for my surprise i can read very well that xml in my browser and the special characters are displayed in a correct way. Could you please explain me why?
    Thanks for your help.

  • Is there any way to set read timeout on JDBC connection?

    When the network connectivity between the machine
    where Database is running and where the application is running breaks,
    the query executed using the old connection handle is not timing out.
    Is there any way to set read timeout on JDBC connection. ?
    FYI, Oracle JDBC thin Driver is used in our application.

    Set the tuning parameters with Embedded OC4J Server Preferences>Current Workspace>Data Sources>jdev-connection-DBConnection1 node.
    Select the Tuning tab.
    The Inactivity Timeout parameter specifies the number of secs of inactivity after which a connection gets disconnected.

Maybe you are looking for

  • Can no longer open a folder while dragging a file into it...

    Suddenly I am unable to drag a file into a folder, hold it over that folder and have the folder open so I can then navigate within that folder before dropping the file (does that make sense?)...it has been working just fine for some time and now it w

  • ZCM and Windows 8

    Hi all, I have ZCm 11.2.3a running nicely with my Windows 7 workstations. Management is now on the move and wants to deploy Windows 8.1 on our devices. So far, I have stalled this move as ZCM does not support 8.1, but they want to know when we can ex

  • Battery screen freeze problem

    Hello, I'm using blackberry 8700c. The screen just shows battery with red cross line image. Even though I pressed a power button or tried to reset with alt+cap+del, the false screen is still there. Is there anyone would have any suggestion for this p

  • How to create Extra Freight Unit for LCL Forwarding Order in Web Version of SAP?

    Hi, Can anyone please tell me how to create Extra Freight Unit in LCL Forwarding Order. Normally, each LCL Forwarding Order has one Freight Unit. But, if there are two types of Dangerous Goods and need to be transported via separate containers. Obvio

  • Why am I seeing my entire Aperture library on ATV?

    I have Aperture selected as to where I want iTunes to get my photos from. I then have the box checked for SELECTED albums etc and then went through and only checked 2 or 3 albums leaving the rest unchecked. When I go to the PHOTOS section within my A