Good day to all. There is an application with Service ohm. It contains the following code connecting to the server:
private Socket mSocket = new Socket(); ... this.mSocket.connect(new InetSocketAddress(this.ipAddress, 81), 60000); Of course, it lies in a separate stream, the IP address is correct and so on, I mean, I did not make stupid mistakes. But in the line this.mSocket.connect(...) exception crashes:
java.net.SocketException: java.io.IOException: fcntl failed: EBADF (Bad file number) at libcore.io.IoBridge.connect (IoBridge.java:120) at java.net.PlainSocketImpl.connect (PlainSocketImpl.java:192 ) at java.net.PlainSocketImpl.connect (PlainSocketImpl.java:459) at java.net.Socket.connect (Socket.java:851) at com.myPackage.I3 $ i2.run (I3.java:260) at java .lang.Thread.run (Thread.java:856)
Caused by: java.io.IOException: fcntl failed: EBADF (Bad file number) at libcore.io.IoBridge.IsBlocking (IoBridge.java:133) at libcore.io.IoBridge.connectErrno (IoBridge.java:142) at libcore .io.IoBridge.connect (IoBridge.java:112) ... 5 more
Caused by: libcore.io.ErrnoException: fcntl failed: EBADF (Bad file number) at libcore.io.Posix.fcntlVoid (Native Method) at libcore.io.ForwardingOs.fcntlVoid (ForwardingOs.java:46) at libcore.io. IoBridge.IsBlocking (IoBridge.java:126) ... 7 more
Here is a list of all application rights in AndroidManifest.xml :
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> <uses-permission android:name="android.permission.CAMERA" /> <uses-permission android:name="android.permission.INTERNET" /> <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" /> <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" /> <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> Help correct the error. I don't know what's wrong.