TCP socket connection from ASP page

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • User Groups

    TCP socket connection from ASP page

    I want to have an asp page that can connect to a TCP listener and send some
    data to it.
    I have done some coding and was able to send data to the listener but for
    one time only.
    As soon as a transmission is over a status of the listener goes into
    close_wait and at the next page submit it's not getting connected to it
    anymore.
    How can I get connected to the listener avery time a page is submitted?

    Thanks for help.


  • =?Utf-8?B?T2xkIFBlZGFudA==?=

    #2
    RE: TCP socket connection from ASP page

    What component are you using to make the connection??

    And are you saying you need the connection to persist from page hit to page
    hit for the same session? Or from page hit to page hit for all users in all
    sessions?

    *POSSIBLY* you could store the component object in a Session or Application
    variable. How bad that is depends on how well implemented your ActiveX
    object is. If it is apartment threaded, it will prove to be a bottleneck,
    especially in a heavily loaded system. If it is free threaded, it might work
    just fine.

    Expecting a TCP connection to survive between page hits...which might occur
    15 or 20 minutes apart...may not be the best strategy in any case. Maybe you
    really should set up the connection and tear it down each time. Or maybe you
    should consider a different implementation altogether (e.g., a Web Service?).


    Comment

    • User Groups

      #3
      Re: TCP socket connection from ASP page

      Let's focus on one session/one user.
      I dont want aconnection to survive at all. I want to connect to a listner
      from asp page
      on every hit, send data to it (listener), and that's all.

      "Old Pedant" <OldPedant@disc ussions.microso ft.comwrote in message
      news:81490458-2674-4C08-9FE0-504D06A47419@mi crosoft.com...
      What component are you using to make the connection??
      >
      And are you saying you need the connection to persist from page hit to
      page
      hit for the same session? Or from page hit to page hit for all users in
      all
      sessions?
      >
      *POSSIBLY* you could store the component object in a Session or
      Application
      variable. How bad that is depends on how well implemented your ActiveX
      object is. If it is apartment threaded, it will prove to be a bottleneck,
      especially in a heavily loaded system. If it is free threaded, it might
      work
      just fine.
      >
      Expecting a TCP connection to survive between page hits...which might
      occur
      15 or 20 minutes apart...may not be the best strategy in any case. Maybe
      you
      really should set up the connection and tear it down each time. Or maybe
      you
      should consider a different implementation altogether (e.g., a Web
      Service?).
      >
      >

      Comment

      • =?Utf-8?B?T2xkIFBlZGFudA==?=

        #4
        Re: TCP socket connection from ASP page

        Okay, that sounds good.

        So why isn't that working now??? Are you saying that you are unable to make
        a second connection to the same socket? Possibly because the first
        connection never go closed?

        And you didn't say what component you are using to do this with. Is it a
        commercial one or did you roll your own?

        There used to be a pretty generic sockets component from ServerObjects.c om
        but they seem to have withdrawn it. Only ones I find are these:


        Comment

        • User Groups

          #5
          Re: TCP socket connection from ASP page

          <Are you saying that you are unable to make
          < a second connection to the same socket
          Exactly. Because the listener goes into close_wait and no connection can be
          done to it.
          I am using Winsock ActiveX control.


          "Old Pedant" <OldPedant@disc ussions.microso ft.comwrote in message
          news:E26C847B-F0AF-488C-A8D1-CB8AD81B208C@mi crosoft.com...
          Okay, that sounds good.
          >
          So why isn't that working now??? Are you saying that you are unable to
          make
          a second connection to the same socket? Possibly because the first
          connection never go closed?
          >
          And you didn't say what component you are using to do this with. Is it a
          commercial one or did you roll your own?
          >
          There used to be a pretty generic sockets component from ServerObjects.c om
          but they seem to have withdrawn it. Only ones I find are these:

          >

          Comment

          • =?Utf-8?B?T2xkIFBlZGFudA==?=

            #6
            Re: TCP socket connection from ASP page

            Exactly. Because the listener goes into close_wait and no connection can be
            done to it.
            I am using Winsock ActiveX control.
            Gotcha. Sorry. Never used this. You'd think it would work, being from MS,
            but....

            I'm *assuming* it goes into close_wait when you attempt to close the
            connection, no? Or do you mean it does so before you attempt the close?
            Ehhh...not that I would know how to fix either condition. Sorry.

            May be time to abandon this control and find another wone to use??




            Comment

            • User Groups

              #7
              Re: TCP socket connection from ASP page

              I am not entirely sure it's because of a control I am using.
              I tried to close connection after data has been sent or leave it and let it
              die because of an asp page life cicle. Same.
              "Old Pedant" <OldPedant@disc ussions.microso ft.comwrote in message
              news:8D186FFE-7E30-4937-ABEC-074E8A83190A@mi crosoft.com...
              >Exactly. Because the listener goes into close_wait and no connection can
              >be
              >done to it.
              >I am using Winsock ActiveX control.
              >
              Gotcha. Sorry. Never used this. You'd think it would work, being from
              MS,
              but....
              >
              I'm *assuming* it goes into close_wait when you attempt to close the
              connection, no? Or do you mean it does so before you attempt the close?
              Ehhh...not that I would know how to fix either condition. Sorry.
              >
              May be time to abandon this control and find another wone to use??
              >
              >
              >
              >

              Comment

              • p byers

                #8
                Re: TCP socket connection from ASP page

                Good Morning
                I am presuming that this technology allows the "Client" to find and go
                directly to the desired IP address rather than being routed via several
                intermediate IP addresses.

                Would someone please have the time, energy and inclination to outline the
                Pro's and Con's of such a Technique ??

                Thanks
                Pete (Northolt UK)

                Old Pedant wrote:
                Okay, that sounds good.
                >
                So why isn't that working now??? Are you saying that you are unable to make
                a second connection to the same socket? Possibly because the first
                connection never go closed?
                >
                And you didn't say what component you are using to do this with. Is it a
                commercial one or did you roll your own?
                >
                There used to be a pretty generic sockets component from ServerObjects.c om
                but they seem to have withdrawn it. Only ones I find are these:
                http://www.aspin.com/home/components/internet/winsockf

                Comment

                • Evertjan.

                  #9
                  Re: TCP socket connection from ASP page

                  p byers wrote on 18 jul 2008 in microsoft.publi c.inetserver.as p.general:
                  Old Pedant wrote:
                  >
                  >Okay, that sounds good.
                  >>
                  >So why isn't that working now??? Are you saying that you are unable
                  >to make a second connection to the same socket? Possibly because the
                  >first connection never go closed?
                  >>
                  >And you didn't say what component you are using to do this with. Is
                  >it a commercial one or did you roll your own?
                  Could you answer that?
                  >There used to be a pretty generic sockets component from
                  >ServerObjects. com but they seem to have withdrawn it. Only ones I
                  >find are these:
                  >http://www.aspin.com/home/components/internet/winsockf
                  [Please do not toppost on usenet]
                  I am presuming that this technology allows the "Client" to find
                  and go
                  directly to the desired IP address rather than being routed via
                  several intermediate IP addresses.
                  >
                  Would someone please have the time, energy and inclination to
                  outline the Pro's and Con's of such a Technique ??
                  Seems far off topic for ASP.

                  --
                  Evertjan.
                  The Netherlands.
                  (Please change the x'es to dots in my emailaddress)

                  Comment

                  • =?Utf-8?B?T2xkIFBlZGFudA==?=

                    #10
                    re: TCP socket connection from ASP

                    >>And you didn't say what component you are using to do this with. Is
                    >>it a commercial one or did you roll your own?
                    Could you answer that?
                    He did answer it. He wrote:
                    "I am using Winsock ActiveX control."

                    That's a control that comes with MS Office. It's a pretty generic one, as I
                    read the docs, and requires that the scripter do all the steps himself. The
                    other commercial ones seem to do a better job of automating the process.
                    Still, I can't see why the connection would just "hang".

                    p.s.: You should have explained what "toppost" means. I doubt that many
                    people use the term any more. Been *years* since I saw it, in fact.


                    Comment

                    • Evertjan.

                      #11
                      re: TCP socket connection from ASP

                      =?Utf-8?B?T2xkIFBlZGF udA==?= wrote on 18 jul 2008 in
                      microsoft.publi c.inetserver.as p.general:
                      >>>And you didn't say what component you are using to do this with. Is
                      >>>it a commercial one or did you roll your own?
                      >
                      >Could you answer that?
                      >
                      He did answer it. He wrote:
                      "I am using Winsock ActiveX control."
                      Do you use that on the server in ASP?
                      That's a control that comes with MS Office. It's a pretty generic
                      one, as I read the docs, and requires that the scripter do all the
                      steps himself. The other commercial ones seem to do a better job of
                      automating the process. Still, I can't see why the connection would
                      just "hang".
                      In ASP?
                      p.s.: You should have explained what "toppost" means.
                      No I should not.
                      It is in the Netiquestte files of usenet all over the web.
                      And you seem to undeerstand well.
                      I doubt that many people use the term any more.
                      Been *years* since I saw it, in fact.
                      You are free to doubt,
                      but it is used often in this and manuy other NGs.

                      --
                      Evertjan.
                      The Netherlands.
                      (Please change the x'es to dots in my emailaddress)

                      Comment

                      • =?Utf-8?B?T2xkIFBlZGFudA==?=

                        #12
                        re: TCP socket connection from ASP

                        "Evertjan." wrote:
                        Do you use [Winsock ActiveX control] on the server in ASP?
                        Sure. Why not?? It's an ActiveX control, meaning it's scriptable. And it
                        doesn't imply any graphical/window usage (that is, it wasn't intended to be
                        used only in a windowing environment).
                        >That's a control that comes with MS Office. It's a pretty generic
                        >one, as I read the docs, and requires that the scripter do all the
                        >steps himself. The other commercial ones seem to do a better job of
                        >automating the process. Still, I can't see why the connection would
                        >just "hang".
                        In ASP?
                        Again, sure. If they are ActiveX controls that don't use windows, then why
                        couldn't/wouldn't you use them in ASP. Or were you doubting my last
                        sentence? Implying that the "hang" might be an artifact of using the control
                        in ASP? If so, that was the point of my suggesting he try some other
                        control, just in case there is some aspect of that control that doesn't play
                        well with ASP. Again, no idea what it might be, but why not experiment a
                        bit? (And with one exception, the list of controls in that URL I pointed him
                        to all specifically *claim* to be for use with ASP.)
                        p.s.: You should have explained what "toppost" means.
                        No I should not.
                        Okay, so maybe I'm more tolerant than you are. Which is mildly funny, since
                        I've been accused of being a nasty responder in the past. ("Past" including
                        day before yesterday. <grin/>) I do agree with you, though. I don't like
                        topposting any place. EMail, forums, whatever. It's a royal pain no matter
                        where you encounter it.

                        Comment

                        Working...