WinSock Error (Error code: 10054)

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

    WinSock Error (Error code: 10054)

    Hi all,

    I am dealing with sockets in my code.

    I open them like -
    System.Net.IPAd dress remoteIPAddress = System.Net.IPAd dress.Parse
    (szIPSelected);
    System.Net.IPEn dPoint remoteEndPoint = new System.Net.IPEn dPoint
    (remoteIPAddres s, alPort);
    // Connect to the remote End point in the socket.
    m_socClient.Con nect(remoteEndP oint);

    After having done my work I close it by-
    m_socClient.Shu tdown(SocketShu tdown.Both);
    m_socClient.Clo se();

    I get an error "An existing connection was forcibly closed by the remote host
    Error code: 10054" after running the application several times.
    Am I missing on something?

    Best regards,
    SK


  • Ivar

    #2
    Re: WinSock Error (Error code: 10054)


    This is normal error, what you must skip or handle.

    This happens when computer you are connected to closes connection(with out
    ShutDown).


    "SK" <sk@hotmail.com > wrote in message
    news:<OuraU10pD HA.3256@tk2msft ngp13.phx.gbl>. ..[color=blue]
    > Hi all,
    >
    > I am dealing with sockets in my code.
    >
    > I open them like -
    > System.Net.IPAd dress remoteIPAddress = System.Net.IPAd dress.Parse
    > (szIPSelected);
    > System.Net.IPEn dPoint remoteEndPoint = new System.Net.IPEn dPoint
    > (remoteIPAddres s, alPort);
    > // Connect to the remote End point in the socket.
    > m_socClient.Con nect(remoteEndP oint);
    >
    > After having done my work I close it by-
    > m_socClient.Shu tdown(SocketShu tdown.Both);
    > m_socClient.Clo se();
    >
    > I get an error "An existing connection was forcibly closed by the remote[/color]
    host[color=blue]
    > Error code: 10054" after running the application several times.
    > Am I missing on something?
    >
    > Best regards,
    > SK
    >
    >[/color]


    Comment

    • SK

      #3
      Re: WinSock Error (Error code: 10054)

      So does that mean that I am bound to get such errors when opening/closing
      sockets many times.
      So is simply ignoring these error messages fine?
      I was thinking that I made some mistake in closing the sockets.

      Best regards,
      SK

      "Ivar" <ivar@lumisoft. ee> wrote in message
      news:#fEVCy1pDH A.2964@tk2msftn gp13.phx.gbl...[color=blue]
      >
      > This is normal error, what you must skip or handle.
      >
      > This happens when computer you are connected to closes connection(with out
      > ShutDown).
      >
      >
      > "SK" <sk@hotmail.com > wrote in message
      > news:<OuraU10pD HA.3256@tk2msft ngp13.phx.gbl>. ..[color=green]
      > > Hi all,
      > >
      > > I am dealing with sockets in my code.
      > >
      > > I open them like -
      > > System.Net.IPAd dress remoteIPAddress = System.Net.IPAd dress.Parse
      > > (szIPSelected);
      > > System.Net.IPEn dPoint remoteEndPoint = new System.Net.IPEn dPoint
      > > (remoteIPAddres s, alPort);
      > > // Connect to the remote End point in the socket.
      > > m_socClient.Con nect(remoteEndP oint);
      > >
      > > After having done my work I close it by-
      > > m_socClient.Shu tdown(SocketShu tdown.Both);
      > > m_socClient.Clo se();
      > >
      > > I get an error "An existing connection was forcibly closed by the remote[/color]
      > host[color=green]
      > > Error code: 10054" after running the application several times.
      > > Am I missing on something?
      > >
      > > Best regards,
      > > SK
      > >
      > >[/color]
      >
      >[/color]


      Comment

      • Ivar

        #4
        Re: WinSock Error (Error code: 10054)

        [color=blue]
        > So is simply ignoring these error messages fine?[/color]
        Usually yes, but it depends if you want notify your app that remote computer
        closed connection.
        [color=blue]
        > I was thinking that I made some mistake in closing the sockets.[/color]
        I'm sure that your destination machine(server) causes this. If you send
        Shutdown() then server won't
        close connection as expected, it just closes it (No shutdown).



        "SK" <sk@hotmail.com > wrote in message
        news:<umzYo71pD HA.2216@TK2MSFT NGP12.phx.gbl>. ..[color=blue]
        > So does that mean that I am bound to get such errors when opening/closing
        > sockets many times.
        > So is simply ignoring these error messages fine?
        > I was thinking that I made some mistake in closing the sockets.
        >
        > Best regards,
        > SK
        >
        > "Ivar" <ivar@lumisoft. ee> wrote in message
        > news:#fEVCy1pDH A.2964@tk2msftn gp13.phx.gbl...[color=green]
        > >
        > > This is normal error, what you must skip or handle.
        > >
        > > This happens when computer you are connected to closes[/color][/color]
        connection(with out[color=blue][color=green]
        > > ShutDown).
        > >
        > >
        > > "SK" <sk@hotmail.com > wrote in message
        > > news:<OuraU10pD HA.3256@tk2msft ngp13.phx.gbl>. ..[color=darkred]
        > > > Hi all,
        > > >
        > > > I am dealing with sockets in my code.
        > > >
        > > > I open them like -
        > > > System.Net.IPAd dress remoteIPAddress = System.Net.IPAd dress.Parse
        > > > (szIPSelected);
        > > > System.Net.IPEn dPoint remoteEndPoint = new System.Net.IPEn dPoint
        > > > (remoteIPAddres s, alPort);
        > > > // Connect to the remote End point in the socket.
        > > > m_socClient.Con nect(remoteEndP oint);
        > > >
        > > > After having done my work I close it by-
        > > > m_socClient.Shu tdown(SocketShu tdown.Both);
        > > > m_socClient.Clo se();
        > > >
        > > > I get an error "An existing connection was forcibly closed by the[/color][/color][/color]
        remote[color=blue][color=green]
        > > host[color=darkred]
        > > > Error code: 10054" after running the application several times.
        > > > Am I missing on something?
        > > >
        > > > Best regards,
        > > > SK
        > > >
        > > >[/color]
        > >
        > >[/color]
        >
        >[/color]


        Comment

        Working...