Home Forums Support Android NullReferenceException in TCPConnection.GetConnection

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #2388
    Anonymous
    Inactive

    Hi, one more Android issue. When I try to create a TCP Connection that can’t be established, because nobody is listening on the remote address, an exception occurs, that can not be caught and crashes the whole application.

    System.NullReferenceException: Object reference not set to an instance of an object

    in System.Net.Sockets.TcpClient.EndConnect	C#
    in NetworkCommsDotNet.Connections.TCP.TCPConnection.ConnectSocket at c:\Users\Karnifexx\Documents\Visual Studio 2010\Projects\networkcomms.net\NetworkCommsDotNet\Connection\TCP\TCPConnection.cs:218	C#
    in NetworkCommsDotNet.Connections.TCP.TCPConnection.EstablishConnectionSpecific at c:\Users\Karnifexx\Documents\Visual Studio 2010\Projects\networkcomms.net\NetworkCommsDotNet\Connection\TCP\TCPConnection.cs:108	C#
    in NetworkCommsDotNet.Connections.Connection.EstablishConnection at c:\Users\Karnifexx\Documents\Visual Studio 2010\Projects\networkcomms.net\NetworkCommsDotNet\Connection\ConnectionCreate.cs:140	C#
    in NetworkCommsDotNet.Connections.TCP.TCPConnection.GetConnection at c:\Users\Karnifexx\Documents\Visual Studio 2010\Projects\networkcomms.net\NetworkCommsDotNet\Connection\TCP\TCPConnectionStatic.cs:171	C#
    in NetworkCommsDotNet.Connections.TCP.TCPConnection.GetConnection at c:\Users\Karnifexx\Documents\Visual Studio 2010\Projects\networkcomms.net\NetworkCommsDotNet\Connection\TCP\TCPConnectionStatic.cs:55	C#
    
    #2392
    Anonymous
    Inactive

    This appears to be a similar issue to this one – https://bitbucket.org/MarcF/networkcomms.net/issue/39/xamarin-android-235.

    Some questions for you:
    1. What version of android are you using when you observe this problem?
    2. Are you able to test on a different version of android to see if the problem persists?

    Kind regards,
    Marc

    #2413
    Anonymous
    Inactive

    Hi Marc,

    I tested it on Android 4.1.2 and 4.2.2 with physical devices, but I could also reproduce it for example on Android 2.3.3 with the emulator. Didn’t test it on further configurations.

    #2414
    Anonymous
    Inactive

    Ok, this appears to be a step forward from the original bug report. We will investigate this further.

    Regards,
    Marc

    #2416
    Anonymous
    Inactive

    Have managed to fix this bug as well. It will be in the update I email you in next few hours.

    Marc

    #2432
    Anonymous
    Inactive

    Hi Marc, thank you very much, it solved the Problem!

    #2450
    Anonymous
    Inactive

    Hi Marc,

    Can I have the fixed version? Thanks

    #2451
    Anonymous
    Inactive

    Have you emailed you jack. Please let us know if you have any issues,

    Regards,
    Marc

    #2455
    Anonymous
    Inactive

    Thank, I will.

    Jack

    #3712
    Anonymous
    Inactive

    NullReferenceException indicates that you are trying to access member fields, or function types, on an object reference that points to null. That means the reference to an Object which is not initialized.. More about….How do I fix NullReferenceException

    Patter

Viewing 10 posts - 1 through 10 (of 10 total)
  • You must be logged in to reply to this topic.