Skip to content

Closing UDPListener makes Unity3D freeze #1

@youegraillot

Description

@youegraillot

I'm using SharpOSC with Unity and when I close the UDPListener Unity freezes.

I fixed the problem by setting a timeout to ClosingEvent.WaitOne(timeout).
I don't know if it's good code but it seems to work now.

public void Close()
        {
            lock (callbackLock)
            {
                ClosingEvent.Reset();
                closing = true;
                receivingUdpClient.Close();
            }

            ClosingEvent.WaitOne(1000);
        }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions