Home Forums Support UDP ObjectDisposedException Error

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #1203
    Anonymous
    Inactive

    I want to send UDP messages every 50ms by using

    UDPConnection.SendObject( newMessageType, data, serverIP, serverPort );

    but i get the following error below. If is simply replace UDP by the TCP send command it works.

    ObjectDisposedException: The object was used after being disposed.
    System.Net.Sockets.UdpClient.CheckDisposed ()
    System.Net.Sockets.UdpClient.Send (System.Byte[] dgram, Int32 bytes, System.Net.IPEndPoint endPoint)
    NetworkCommsDotNet.UdpClientThreadSafe.Send (System.Byte[] dgram, Int32 bytes, System.Net.IPEndPoint endPoint)
    NetworkCommsDotNet.UDPConnection.SendPacketSpecific (NetworkCommsDotNet.Packet packet, System.Net.IPEndPoint ipEndPoint)
    NetworkCommsDotNet.UDPConnection.SendObject (System.String sendingPacketType, System.Object objectToSend, System.Net.IPEndPoint ipEndPoint, NetworkCommsDotNet.SendReceiveOptions sendReceiveOptions)
    NetworkCommsDotNet.UDPConnection.SendObject (System.String sendingPacketType, System.Object objectToSend, System.Net.IPEndPoint ipEndPoint)
    NetworkCommsDotNet.UDPConnection.SendObject (System.String sendingPacketType, System.Object objectToSend, System.String ipAddress, Int32 port)
    Client.SendUDP (Int32 messageType, System.Object data) (at Assets/Scripts/Client.cs:251)
    Client.SendClientPosition () (at Assets/Scripts/Client.cs:222)
    Client.ClientProcess () (at Assets/Scripts/Client.cs:132)
    Client.FixedUpdate () (at Assets/Scripts/Client.cs:124)

    #1205
    Anonymous
    Inactive

    Unfortunately right now I’m not able to reproduce this error. I’ve only tried it in a console app on a loopback adapter so far but as I was expecting it is not a general problem with networkComms.net. As such we need to know a little bit more about your set-up and what you’re trying to do.

    What platform is this running on at the client and server ends? What sort of physical network links the client and server? Is the object your trying to send a custom object and is it quite large? Is there anything you can think of that is particularly unusual about your set-up? Is the error thrown on all sends or just some of the time?

    This should hopefully be a relatively simple problem to solve once we know where the issue is.

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