Uploaded image for project: 'ActiveMQ .Net'
  1. ActiveMQ .Net
  2. AMQNET-502

When a SocketException is thrown in DoConnect, invalid exception message is generated

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 1.6.4, 1.7.0
    • Fix Version/s: 1.7.1
    • Component/s: ActiveMQ
    • Labels:
    • Environment:

      Windows Server 2012, Visual Studio 2015

      Description

      When attempting to connect the TCP socket in TcpTransportFactory.cs in the ```DoConnect(host, port, localAddress, localPort)``` proc if all attempts to call
      ```TryConnectSocket(ipaddress, port, localAddress, localPort)```
      are unsucessful ( resulting in socket == null) at line 375 a
      ```throw new SocketException();```
      is generated.

      Since this SocketException has not message in it, it is then caught in turn at line 380 and repackaged as
      ```throw new NMSConnectionException(String.Format("Error connecting to

      {0}

      :

      {1}

      .", host, port), ex);```

      Unfortunately when a SocketException is thrown with no default error message, the inner exception text shows as "The operation completed successfully" for any client consuming application.

      I recommend that we give back some more meaningful and relevant information.

      ```InnerException:
      ErrorCode=0
      HResult=-2147467259
      Message=The operation completed successfully
      NativeErrorCode=0
      Source=Apache.NMS.ActiveMQ
      StackTrace:
      at Apache.NMS.ActiveMQ.Transport.Tcp.TcpTransportFactory.DoConnect(String host, Int32 port, String localAddress, Int32 localPort)
      ```

        Attachments

          Activity

            People

            • Assignee:
              jgomes Jim Gomes
              Reporter:
              xsgeek Matthew Hintzen
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - 1h
                1h
                Remaining:
                Remaining Estimate - 1h
                1h
                Logged:
                Time Spent - Not Specified
                Not Specified