Socket problem

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Laszlo Csabi

    #1

    Socket problem

    Hi Folks,

    I'm using c# to create a server client application.
    I have to check if the socket is in"CLOSE_WAIT " state. Anyone knows any
    solution for this?

    I tried to used Socket.Connecte d but it doesn't give a false message if the
    socket is in "CLOSE_WAIT " state.

    Thanks

    Laszlo


  • SRLoka

    #2
    Re: Socket problem

    I would be interested in knowing the solution too. I had the same problem.
    What I ended up doing is timestamping the last time the client sent data and
    if the client is idle for a certain period of time(10 minutes), close the
    connection from the server end.

    Thanks
    Srinivas

    "Laszlo Csabi" <lc@ynotcallme. com> wrote in message
    news:O19thCdVFH A.2420@TK2MSFTN GP12.phx.gbl...[color=blue]
    > Hi Folks,
    >
    > I'm using c# to create a server client application.
    > I have to check if the socket is in"CLOSE_WAIT " state. Anyone knows any
    > solution for this?
    >
    > I tried to used Socket.Connecte d but it doesn't give a false message if
    > the socket is in "CLOSE_WAIT " state.
    >
    > Thanks
    >
    > Laszlo
    >
    >[/color]


    Comment

    • MisterT

      #3
      Re: Socket problem

      Hello,

      I have had the same problem. I have narrowed it down to a server side
      problem. The server does not seem to be closing the connection properly.

      I have tried some commericial socket controls to see how they work, and they
      do not leave the clients in a CLOSE_WAIT. May have to go with a commerical
      control.

      Good luck.

      "SRLoka" wrote:
      [color=blue]
      > I would be interested in knowing the solution too. I had the same problem.
      > What I ended up doing is timestamping the last time the client sent data and
      > if the client is idle for a certain period of time(10 minutes), close the
      > connection from the server end.
      >
      > Thanks
      > Srinivas
      >
      > "Laszlo Csabi" <lc@ynotcallme. com> wrote in message
      > news:O19thCdVFH A.2420@TK2MSFTN GP12.phx.gbl...[color=green]
      > > Hi Folks,
      > >
      > > I'm using c# to create a server client application.
      > > I have to check if the socket is in"CLOSE_WAIT " state. Anyone knows any
      > > solution for this?
      > >
      > > I tried to used Socket.Connecte d but it doesn't give a false message if
      > > the socket is in "CLOSE_WAIT " state.
      > >
      > > Thanks
      > >
      > > Laszlo
      > >
      > >[/color]
      >
      >
      >[/color]

      Comment

      • SRLoka

        #4
        Re: Socket problem

        Thanks. Can you list a few that you have tried ?
        I think its something to do with .Net . Even if the cleint disconnects, the
        Write does not throw an exception and Can Write is still true.


        "MisterT" <MisterT@discus sions.microsoft .com> wrote in message
        news:11708721-9B6E-432B-BCAE-6F8F102776DE@mi crosoft.com...[color=blue]
        > Hello,
        >
        > I have had the same problem. I have narrowed it down to a server side
        > problem. The server does not seem to be closing the connection properly.
        >
        > I have tried some commericial socket controls to see how they work, and
        > they
        > do not leave the clients in a CLOSE_WAIT. May have to go with a
        > commerical
        > control.
        >
        > Good luck.
        >
        > "SRLoka" wrote:
        >[color=green]
        >> I would be interested in knowing the solution too. I had the same
        >> problem.
        >> What I ended up doing is timestamping the last time the client sent data
        >> and
        >> if the client is idle for a certain period of time(10 minutes), close the
        >> connection from the server end.
        >>
        >> Thanks
        >> Srinivas
        >>
        >> "Laszlo Csabi" <lc@ynotcallme. com> wrote in message
        >> news:O19thCdVFH A.2420@TK2MSFTN GP12.phx.gbl...[color=darkred]
        >> > Hi Folks,
        >> >
        >> > I'm using c# to create a server client application.
        >> > I have to check if the socket is in"CLOSE_WAIT " state. Anyone knows
        >> > any
        >> > solution for this?
        >> >
        >> > I tried to used Socket.Connecte d but it doesn't give a false message if
        >> > the socket is in "CLOSE_WAIT " state.
        >> >
        >> > Thanks
        >> >
        >> > Laszlo
        >> >
        >> >[/color]
        >>
        >>
        >>[/color][/color]


        Comment

        • MisterT

          #5
          Re: Socket problem

          Hello,

          The Dart TCP Socket .NET control works great. It costs $249. IP Works
          also has a good one, but it costs $399.

          I have seen other posts on the internet where people are frustrated with the
          ..NET Socket offering.

          Thanks

          "SRLoka" wrote:
          [color=blue]
          > Thanks. Can you list a few that you have tried ?
          > I think its something to do with .Net . Even if the cleint disconnects, the
          > Write does not throw an exception and Can Write is still true.
          >
          >
          > "MisterT" <MisterT@discus sions.microsoft .com> wrote in message
          > news:11708721-9B6E-432B-BCAE-6F8F102776DE@mi crosoft.com...[color=green]
          > > Hello,
          > >
          > > I have had the same problem. I have narrowed it down to a server side
          > > problem. The server does not seem to be closing the connection properly.
          > >
          > > I have tried some commericial socket controls to see how they work, and
          > > they
          > > do not leave the clients in a CLOSE_WAIT. May have to go with a
          > > commerical
          > > control.
          > >
          > > Good luck.
          > >
          > > "SRLoka" wrote:
          > >[color=darkred]
          > >> I would be interested in knowing the solution too. I had the same
          > >> problem.
          > >> What I ended up doing is timestamping the last time the client sent data
          > >> and
          > >> if the client is idle for a certain period of time(10 minutes), close the
          > >> connection from the server end.
          > >>
          > >> Thanks
          > >> Srinivas
          > >>
          > >> "Laszlo Csabi" <lc@ynotcallme. com> wrote in message
          > >> news:O19thCdVFH A.2420@TK2MSFTN GP12.phx.gbl...
          > >> > Hi Folks,
          > >> >
          > >> > I'm using c# to create a server client application.
          > >> > I have to check if the socket is in"CLOSE_WAIT " state. Anyone knows
          > >> > any
          > >> > solution for this?
          > >> >
          > >> > I tried to used Socket.Connecte d but it doesn't give a false message if
          > >> > the socket is in "CLOSE_WAIT " state.
          > >> >
          > >> > Thanks
          > >> >
          > >> > Laszlo
          > >> >
          > >> >
          > >>
          > >>
          > >>[/color][/color]
          >
          >
          >[/color]

          Comment

          Working...