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. C#
  4. How to preserve Globally Connection Object?

How to preserve Globally Connection Object?

Scheduled Pinned Locked Moved C#
csharpquestionsysadmintutorial
4 Posts 4 Posters 1 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.
  • V Offline
    V Offline
    vaibhavnvag
    wrote on last edited by
    #1

    I am using Client-server Architeture for my c#.net Window base Application. For that I am using TCP Remoting. How can I preserve Connection object? means Only once Connection will establish while log in.and it will available me through life time of application.

    Hallo

    B N P 3 Replies Last reply
    0
    • V vaibhavnvag

      I am using Client-server Architeture for my c#.net Window base Application. For that I am using TCP Remoting. How can I preserve Connection object? means Only once Connection will establish while log in.and it will available me through life time of application.

      Hallo

      B Offline
      B Offline
      bertvan
      wrote on last edited by
      #2

      Singleton Pattern? Been a while since I learned about it, but as I remember, it does the trick

      1 Reply Last reply
      0
      • V vaibhavnvag

        I am using Client-server Architeture for my c#.net Window base Application. For that I am using TCP Remoting. How can I preserve Connection object? means Only once Connection will establish while log in.and it will available me through life time of application.

        Hallo

        N Offline
        N Offline
        Niiiissssshhhhhuuuuu
        wrote on last edited by
        #3

        Hello, May be you can try to store that object using binary serialization and use it any time you want. This is just one idea I want to share with you.:~ :~ :~ :~ nishu

        1 Reply Last reply
        0
        • V vaibhavnvag

          I am using Client-server Architeture for my c#.net Window base Application. For that I am using TCP Remoting. How can I preserve Connection object? means Only once Connection will establish while log in.and it will available me through life time of application.

          Hallo

          P Offline
          P Offline
          Pete OHanlon
          wrote on last edited by
          #4

          It's dangerous to assume that the connection will always be there throughout the life of your application. What happens if the machine at the other end is restarted? Your connection is no longer valid, and operations on it will fail.

          the last thing I want to see is some pasty-faced geek with skin so pale that it's almost translucent trying to bump parts with a partner - John Simmons / outlaw programmer
          Deja View - the feeling that you've seen this post before.

          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