Unity3d socket Connection C#server appears Unity3d editor starts the connection again Unity3d editor snaps to death right away

Source: Internet
Author: User

Unity3d socket and C#server communication is normal for the first time connection. After the customer service end segment is closed. The Unity3d editor starts the connection again unity3d the editor is now stuck because the socket is in an asynchronous state, and the async thread is not managed by unity.

This causes unity to remain in a handshake with socketserver and cannot be established again at the server when it starts again.

My workaround is to enable the Exit Function Onapplicationquit () within the script. Because my socket is written in a singleton, so my code, such as the following, is the truth.

  void Onapplicationquit ()    {        mysocket.getinstance (). Closed ();    }


Unity3d socket Connection C#server appears Unity3d editor starts the connection again Unity3d editor snaps to death right away

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.