Need help for Error - Exception from HRESULT: 0x800A0057

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • remya1000
    New Member
    • Apr 2007
    • 115

    #1

    Need help for Error - Exception from HRESULT: 0x800A0057

    i'm using VB.NET 2003 application program.

    i'm using WinSock in this program. on Page_Load, i used this code

    Code:
            winsock1.Close()
            winsock1.LocalPort = 1223
            winsock1.Bind()
    when i run this program i'm getting .net error. error i'm getting is

    See the end of this message for details on invoking
    just-in-time (JIT) debugging instead of this dialog box.

    ************** Exception Text **************
    System.Reflecti on.TargetInvoca tionException: Exception has been thrown by the target of an invocation. ---> System.Runtime. InteropServices .COMException (0x800A0057): Exception from HRESULT: 0x800A0057
    at MSWinsockLib.IM SWinsockControl .Bind(Object LocalPort, Object LocalIP)
    --- End of inner exception stack trace ---
    if anyone have anyidea what this error means, then please help me... i search this error, but couldn't find any help. can you please help me to figure out what this error means...

    thank in advance.
  • Plater
    Recognized Expert Expert
    • Apr 2007
    • 7872

    #2
    Well I don't know what the COM error you are getting is, but I would suggest trying to use .NET objects. At least that way you might get a meaningful answer.


    Also, you appear to be making a webapplication, you are aware that the socket code yo uare trying to run will happen on the SERVER and not the CLIENT right?

    Comment

    • remya1000
      New Member
      • Apr 2007
      • 115

      #3
      thanks for for your reply...

      this program is used by couple of our clients. for everyone it works fine, only 1 client getting this .NET error. and for the client who gets this error, this program works fine for long time and they said all of the sudden now this .net error start pop up.

      See the end of this message for details on invoking
      just-in-time (JIT) debugging instead of this dialog box.

      ************** Exception Text **************
      System.Reflecti on.TargetInvoca tionException: Exception has been thrown by the target of an invocation. ---> System.Runtime. InteropServices .COMException (0x800A0057): Exception from HRESULT: 0x800A0057
      at MSWinsockLib.IM SWinsockControl .Bind(Object LocalPort, Object LocalIP)
      --- End of inner exception stack trace ---
      to double check which line makes this error, i added some logs
      Code:
                gLog.Write("1")
              winsock1.Close()
               gLog.Write("2")
              winsock1.LocalPort = 1223
               gLog.Write("3")
              winsock1.Bind()
               gLog.Write("4")
      and when i checked the log after running the program. the log contain
      1
      2
      3
      after that .net error is showing.

      so i changed winsock1.Close( ) at the beginning and tried
      Code:
               gLog.Write("1")
              winsock1.LocalPort = 1223
              gLog.Write("2")
              winsock1.Bind()
              gLog.Write("3")
      no change.. same error at same line.

      so i try changing the port number and tried
      Code:
               gLog.Write("1")
              winsock1.Close()
               gLog.Write("2")
              winsock1.LocalPort = 1227
               gLog.Write("3")
              winsock1.Bind()
              gLog.Write("4")
      no change.. same error at same line.

      if anyone have anyidea what this error means, then please help me... i search this error, but couldn't find any help. can you please help me to figure out what this error means...

      thank in advance.

      Comment

      • Plater
        Recognized Expert Expert
        • Apr 2007
        • 7872

        #4
        Well Bind() is probably failing because the port is in use, which stands to reason if its running a second time.

        You wrote that this is a 2003 application, but you said "page_load( )", is this a web application or a windows application?

        Comment

        • remya1000
          New Member
          • Apr 2007
          • 115

          #5
          yes, Bind() is failing. so i tried changing the port number. but same error same line.

          yes, its VB.NET 2003 application. its windows application. i'm sorry i made a mistake while typing. its not "Page_load" , its "Form_Load" . on Form_Load, i have these codes.

          Comment

          • Plater
            Recognized Expert Expert
            • Apr 2007
            • 7872

            #6
            Hmm, is it possible that that user has some special firewall/security settings on their PC that don't allow you to bind port?

            I still recomend you stop using outdated controls in .NET applications and investigate System.Net.Sock ets.Socket and the derrived classes (TcpClient and in this case, TcpListener)

            Comment

            Working...