Login  
Search All Forums
Dart Home | PowerTCP Emulation for .NET | Custom Development Reply | PowerTCP Emulation for .NET Topics | Forums   
AuthorForum: PowerTCP Emulation for .NET
Topic: TelnetStream.Available not detecting data (v1.1.0)
Geo

From: Denver, CO USA
Posts: 1
Member Since: 06/29/07
posted June 22, 2010 2:07 PM

I have a section of code that looks at the .Available property before receiving data segments and has been working for several years. Recently we moved the application to new Win2008 64bit servers and I'm seeing some strange behavior. The .Available property remains at 0 for up to 45 seconds or more before the value changes to > 0.

In contrast, when I run a telnet session manually to the same network device, data is received immediately. I send a command and the device immediately responds back. When I use my application, the delay is just as I stated above.

There is a property of the NIC called "TCP Chimney Offload" which appears to be new to Windows 2008 in which "established TCP connections are handed off to the NIC for processing and the traffic bypasses any NDIS intermediate drivers (including WinPcap)" (source: http://www.answerspice.com/c118/1771189/not-seeing-all-traffic-with-wireshark-and-windows). Our new servers have this property enabled and seems to be a good thing in the overall scheme of things.

More info about the TCP Chimney property here: http://support.microsoft.com/kb/951037

My question is, is this TCP Chimney property affecting how the .Available property is detecting network data? And whether it does or not, is there anything I can do to 'help it along', so to speak, in detecting network data that is clearly there?

Any assistance would be greatly appreciated.
Thanks,
George


Here's an example of the code section:

// The setup is in constructor of class
// Set up Telnet object, the connected object and a session buffer
// ----------------------------------------------------
Session = new Telnet();
Session.NoDelay = false;     // false is default but tried both
Session.ReceiveTimeout = 15000; // Initial value for connection to hosts. This is changed for commands.
Session.TerminalType = "vt220";
Session.ConnectedChangedEx += new Dart.PowerTCP.Telnet.EventHandlerEx(ConnectedChangedHandler);
SessionBuffer = new StringBuilder();
// ----------------------------------------------------

// Shortened version of method but covers the important parts
private string SendToNE(string command, string responsePattern)
{
  // Initialize return value;
  string neResponse = string.Empty;
  
  try
  {
    // Submit the command.
    Session.Send(command);

    // Get response
    StringBuilder rawBuffer = new StringBuilder();
    StringBuilder cleanBuffer = new StringBuilder();
    WaitResponseTime = 15; // seconds
    
    for (int i = 0; i < WaitResponseTime; i++)
    {
      Thread.Sleep(1000 * i);    // THE " * i" IS THE FIX FOR THE LONG DELAY ON NEW SERVERS
      if (Session.Available > 0)  // VALUE COMMONLY STAYS AT 0 FOR 45 SECONDS OR MORE
      {
        Segment seg = Session.Receive();
        rawBuffer.Append(seg.ToString());
        cleanBuffer.Append(FilterSegment(seg)); // special method that 'cleans' the data stream of screen control characters

        if (Regex.IsMatch(cleanBuffer.ToString(), responsePattern))
        {
          Match m = Regex.Match(cleanBuffer.ToString(), responsePattern);
          return m.ToString();
        }

        // Reset the try count. We're looking for inactivity for the total number of WaitResponseTime seconds.
        i = -1;
      }
    }
    SessionBuffer.Append(rawBuffer.ToString());
  }
  catch (SocketException ex)
  {
    neResponse = "SendToNE Socket Exception: " + ex.Message;  
  }

  return neResponse;

}

Jason Farrar (Admin)

From: USA
Posts: 223
Member Since: 07/24/07

Extra Support Options
Custom Application Development

posted July 7, 2010 3:53 PM

I've not been able to actually confirm that the TCP Chimney setting is what is causing the problem as I do not have compatible hardware to test with but from the descriptions of what it does I would hazard the guess that it could be the cause.

What happens if you simply remove the check to Available and attempt to read the stream? We'd like to determine whether the issue is that the data is actually not available or that the data is there but the reporting of it is delayed fro some reason. Do you happen to know if the problem is resolved if you disable the TCP Chimney?

Also it seems that TCP Chimney has been around since Server 2003 but was an OOB option, and as I mentioned earlier requires compatible hardware to be used.

------
-Non-current subscribers must contact sales@dart.com to update subscription and receive continued support as needed.
------

Reply | PowerTCP Emulation for .NET Topics | Forums   
This site is powered by PowerTCP WebServer Tool PowerTCP WebServer for ActiveX