bind socket报EACCES(Permission denied)错误

使用的端口是443端口。

通过apk运行bin文件中的bind socket方法,一直报EACCES (Permission denied)错误。

查网上资料,基本解决方法都是加权限以及不在UI线程中运行连接网络的部分,我按此修改了之后,都没有效果。

估计是因为端口号是443端口,是保留端口的缘故?

查bind的文档,针对此错误的解释:

EACCES The address is protected, and the user is not the superuser.

直接运行此bin文件没有问题,是因为此时是superuser吧。
参考链接:
4 ways to fix bind permission denied in Linux

你可能感兴趣的:(bind)