Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. .NET (Core and Framework)
  4. McAfee and Async Sockets

McAfee and Async Sockets

Scheduled Pinned Locked Moved .NET (Core and Framework)
csharpsysadminhelpquestionlounge
4 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    Aurelius1664
    wrote on last edited by
    #1

    Possible Problem With Sockets 2.0 Implementation in .NET 2 with McAfee Software? McAfee (Privacy Filter and Personal Firewall) installs it's own TCP/IP driver layer. This new driver does not seem to support sockets correctly. When attempting to connect to a remote server IPv4 TCP/IP using the Async BeginConnect you get "not supported on this object type" (unistall the Mcafee driver and it all works fine). If you do a sync connect using Connect the connection is established . However, if you then try to do an async send after connecting you don't just get an exception you get a full blown unmanaged general protection fault. This seems to be a pretty big problem has anyone else out there experienced it or maybe got a work around?

    M 1 Reply Last reply
    0
    • A Aurelius1664

      Possible Problem With Sockets 2.0 Implementation in .NET 2 with McAfee Software? McAfee (Privacy Filter and Personal Firewall) installs it's own TCP/IP driver layer. This new driver does not seem to support sockets correctly. When attempting to connect to a remote server IPv4 TCP/IP using the Async BeginConnect you get "not supported on this object type" (unistall the Mcafee driver and it all works fine). If you do a sync connect using Connect the connection is established . However, if you then try to do an async send after connecting you don't just get an exception you get a full blown unmanaged general protection fault. This seems to be a pretty big problem has anyone else out there experienced it or maybe got a work around?

      M Offline
      M Offline
      Mike Dimmick
      wrote on last edited by
      #2

      I'd guess they don't support binding to a completion port, or something like that. In the first instance complain to McAfee since their stack is at fault. It's possible that the kernel simply has a specific list of things that can bind to completion ports. For some uses of the asynchronous pattern, .NET queues a work item to the thread pool and simply runs the synchronous version on the thread pool thread. For sockets, it's different: asynchronous I/Os are used. If the OS supports it - NT, 2000, XP, 2003 and successors - the socket is bound to a completion port which is a highly scalable way of receiving I/O completion notifications; otherwise it uses overlapped I/Os. In any case, the notification that the I/O is complete ends up on the thread pool, which then calls your callback function. .NET 2.0 adds a new property to the Socket class which can be used to force the overlapped I/O mechanism and turn off the completion port feature: UseOnlyOverlappedIO. Set to true to stop it using the completion port. This may work around the problem, but McAfee really should fix it - .NET 1.x will always use the completion port if it's available. Stability. What an interesting concept. -- Chris Maunder

      A 1 Reply Last reply
      0
      • M Mike Dimmick

        I'd guess they don't support binding to a completion port, or something like that. In the first instance complain to McAfee since their stack is at fault. It's possible that the kernel simply has a specific list of things that can bind to completion ports. For some uses of the asynchronous pattern, .NET queues a work item to the thread pool and simply runs the synchronous version on the thread pool thread. For sockets, it's different: asynchronous I/Os are used. If the OS supports it - NT, 2000, XP, 2003 and successors - the socket is bound to a completion port which is a highly scalable way of receiving I/O completion notifications; otherwise it uses overlapped I/Os. In any case, the notification that the I/O is complete ends up on the thread pool, which then calls your callback function. .NET 2.0 adds a new property to the Socket class which can be used to force the overlapped I/O mechanism and turn off the completion port feature: UseOnlyOverlappedIO. Set to true to stop it using the completion port. This may work around the problem, but McAfee really should fix it - .NET 1.x will always use the completion port if it's available. Stability. What an interesting concept. -- Chris Maunder

        A Offline
        A Offline
        Aurelius1664
        wrote on last edited by
        #3

        Thanks for your help, I tried enabling the UseOnlyOverlappedIO property on the Socket but it did not seem to have any impact. When the BeginConnect is executed I still receive the error "The attempted operation is not supported for the type of object referenced". If I remove McAfee this line works fine. Below is a code snippet in case I am missing something. I have raised this with McAfee and Microsoft but I suspect it's going to be a case of bug ping pong for a while. // Create remote end point and prepare socket (m_sHost="www.google.co.uk" m_iPort=80) ipendRemote = new IPEndPoint(Dns.GetHostEntry(m_sHost).AddressList[0], m_iPort); m_sockDestination = new Socket(ipendRemote.AddressFamily, SocketType.Stream, ProtocolType.Tcp); // Attempt Mcafee fix m_sockDestination.UseOnlyOverlappedIO = true; // Start the connection process m_sockDestination.BeginConnect(ipendRemote, new AsyncCallback(this.OnConnected), m_sockDestination);

        M 1 Reply Last reply
        0
        • A Aurelius1664

          Thanks for your help, I tried enabling the UseOnlyOverlappedIO property on the Socket but it did not seem to have any impact. When the BeginConnect is executed I still receive the error "The attempted operation is not supported for the type of object referenced". If I remove McAfee this line works fine. Below is a code snippet in case I am missing something. I have raised this with McAfee and Microsoft but I suspect it's going to be a case of bug ping pong for a while. // Create remote end point and prepare socket (m_sHost="www.google.co.uk" m_iPort=80) ipendRemote = new IPEndPoint(Dns.GetHostEntry(m_sHost).AddressList[0], m_iPort); m_sockDestination = new Socket(ipendRemote.AddressFamily, SocketType.Stream, ProtocolType.Tcp); // Attempt Mcafee fix m_sockDestination.UseOnlyOverlappedIO = true; // Start the connection process m_sockDestination.BeginConnect(ipendRemote, new AsyncCallback(this.OnConnected), m_sockDestination);

          M Offline
          M Offline
          Mike Dimmick
          wrote on last edited by
          #4

          I've just seen a blog post[^] by the Windows Networking development team talking about how Layered Service Providers behave with a mix of different sockets. This might have some impact on your problem, I'm not sure. If you're still having the problem, you could try posting a comment to that blog entry. Stability. What an interesting concept. -- Chris Maunder

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups