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. Remoting loses subscription but not proxy

Remoting loses subscription but not proxy

Scheduled Pinned Locked Moved .NET (Core and Framework)
csharpsysadminhelpquestion
2 Posts 1 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.
  • J Offline
    J Offline
    John Whitmire
    wrote on last edited by
    #1

    The scenario: 1. Windows service, running on 2 machines; each marshals a singleton remoting object. 2. Events are passed thru an intermediary per recommendations in articles on Remoting Events. 3. Client, running on one of the 2 machines, connects to both services via remoting (TCP) and receives events from both. 4. Then... the LAN is physically disconnected from the client machine. 5. Loss of connection to the "other" machine is correctly noted and handled. Reconnection of the LAN cable results in correct recovery of that remoting connection. No problem there. 6. Problem: The next event delivery from the "local" service fails with "The connection was forcibly closed..." (Why, pray tell?) and the event delegate is appropriately removed (it's an expected result when the client "leaves"). The remoting proxy to the local service remains intact, so the client never knows that its event subscription has been lost and it never gets restored. X| 7. Oddity: If the LAN cable is unplugged before the client attempts the remoting connections, the resulting subscription to the local server events is unaffected by subsequent LAN connections and disconnections! :~ Obviously, something about the remoting path is different. Q1: Can I force the insulated connection that occurs in (7) to happen even when the LAN is present? Q2: Failing Q1, can I detect or prevent the loss of the event connection that occurs in (6)? (C# explanations preferred)

    J 1 Reply Last reply
    0
    • J John Whitmire

      The scenario: 1. Windows service, running on 2 machines; each marshals a singleton remoting object. 2. Events are passed thru an intermediary per recommendations in articles on Remoting Events. 3. Client, running on one of the 2 machines, connects to both services via remoting (TCP) and receives events from both. 4. Then... the LAN is physically disconnected from the client machine. 5. Loss of connection to the "other" machine is correctly noted and handled. Reconnection of the LAN cable results in correct recovery of that remoting connection. No problem there. 6. Problem: The next event delivery from the "local" service fails with "The connection was forcibly closed..." (Why, pray tell?) and the event delegate is appropriately removed (it's an expected result when the client "leaves"). The remoting proxy to the local service remains intact, so the client never knows that its event subscription has been lost and it never gets restored. X| 7. Oddity: If the LAN cable is unplugged before the client attempts the remoting connections, the resulting subscription to the local server events is unaffected by subsequent LAN connections and disconnections! :~ Obviously, something about the remoting path is different. Q1: Can I force the insulated connection that occurs in (7) to happen even when the LAN is present? Q2: Failing Q1, can I detect or prevent the loss of the event connection that occurs in (6)? (C# explanations preferred)

      J Offline
      J Offline
      John Whitmire
      wrote on last edited by
      #2

      RESOLVED: The solution is to use IPC on the local machine for both directions--the proxy and the callbacks. When doing so, though, the IPC channel for callbacks has to be hidden from the marshaling on remote machines. See http://www.microsoft.com/communities/newsgroups/en-us/default.aspx?dg=microsoft.public.dotnet.framework.remoting&mid=f5d1bb8b-2fa8-4347-82f0-12957a8f9776[^] for more detail.

      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