Skip to content

android.os.NetworkOnMainThreadException #3

Description

@Luffy-D-Monkey

client执行发送消息的时候,会抛出这个异常,
这个Exception在android6.0的时候google没有处理,在android7.0之后进行了修正,规定socket IO 操作不能在主线程中执行。简单方法是把发送消息的任务放在子线程中执行。

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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