Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SocketException in Azure #12

Open
LarsBlaabjerg opened this issue Jun 24, 2015 · 2 comments
Open

SocketException in Azure #12

LarsBlaabjerg opened this issue Jun 24, 2015 · 2 comments

Comments

@LarsBlaabjerg
Copy link

Hi,

I get a SocketException when using the UdpTraceListener in Azure (I changed the real IP/port in the trace below).

System.Net.Sockets.SocketException (0x80004005): An address incompatible with the requested protocol was used [::ffff:10.0.0.181]:9000
   at System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress)
   at System.Net.Sockets.Socket.Connect(EndPoint remoteEP)
   at System.Net.Sockets.Socket.Connect(IPAddress address, Int32 port)
   at Splunk.Logging.Util.OpenUdpSocket(IPAddress host, Int32 port) in c:\Users\Lars\Documents\Visual Studio 2013\Projects\splunk-library-dotnetlogging-master\src\Splunk.Logging.Common\Util.cs:line 36
   at Splunk.Logging.UdpTraceListener..ctor(IPAddress host, Int32 port) in c:\Users\Lars\Documents\Visual Studio 2013\Projects\splunk-library-dotnetlogging-master\src\Splunk.Logging.TraceListener\UdpTraceListener.cs:line 42
   at Splunk.Logging.UdpTraceListener..ctor(String host, Int32 port) in c:\Users\Lars\Documents\Visual Studio 2013\Projects\splunk-library-dotnetlogging-master\src\Splunk.Logging.TraceListener\UdpTraceListener.cs:line 50
   at Kiloo.PurchaseValidation.ServiceAPI.WebApiConfig.Register(HttpConfiguration config) in d:\BuildAgents\Thor\work\fa06a442553e9bbb\Kiloo.PurchaseValidation.ServiceAPI\App_Start\WebApiConfig.cs:line 27

The TcpTraceListener makes the process hang.

I found, that when creating the instance of System.Net.Sockets.Socket, if you specify the address family like this in Util.cs:

public static Socket OpenUdpSocket(IPAddress host, int port)
{
    var socket = new Socket(host.AddressFamily, SocketType.Dgram, ProtocolType.Udp);
    socket.Connect(host, port);
    return socket;
}

and like this in TcpSocketWriter.cs:

..
    try
    {
        var socket = new Socket(host.AddressFamily, SocketType.Stream, ProtocolType.Tcp);
        socket.Connect(host, port);
        return socket;
    }
    catch (SocketException e)
...

Things work the way they should.

Hope you fix it soon as I'd rather use the "official" version than compile my own.

I'm using the following setup:
Library Version: Splunk.Logging.TraceListener 1.1.0 and Splunk.Logging.Common 1.1.0
Platform: Azure, not really sure about anything more specific than that.
Framework Version: .NET 4.5.1, Visual Studio Professional 2013
Splunk Version: 6.2.1

@itay
Copy link

itay commented Jun 24, 2015

@LarsBlaabjerg thank you for the bug report - we will look into it. As always, we welcome and appreciate pull requests if you would like to contribute.

shakeelmohamed pushed a commit that referenced this issue Sep 22, 2015
…cat from bugfix/DVPL-6421-rename-http-input-in-.net-logging to develop

* commit '2497887cf7e859d40c66818a9b481ae4cabb3c30':
  Refactoring http input -> http event collector
@LarsBlaabjerg
Copy link
Author

Any chance this will ever make it into a release?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants