ValDog Active Member Licensed User Longtime User Nov 27, 2014 #1 I'm trying to connect my Android to PC for file transfer using the respective AsyncStreamsObject Example programs on the PC side and the Android side. I've open a port (Windows 7 ) under TCP protocol and use that port number in the Android program. I get the following error: "libcore.io.ErrnoException; fcntl failed EBADF (bad file number)" when I try to connect from my Android. Looking for some help please! Last edited: Nov 27, 2014
I'm trying to connect my Android to PC for file transfer using the respective AsyncStreamsObject Example programs on the PC side and the Android side. I've open a port (Windows 7 ) under TCP protocol and use that port number in the Android program. I get the following error: "libcore.io.ErrnoException; fcntl failed EBADF (bad file number)" when I try to connect from my Android. Looking for some help please!
Erel B4X founder Staff member Licensed User Longtime User Nov 28, 2014 #2 It is not related to AsyncStreamsObject. It is a network issue. Try this B4J + B4A example: https://www.b4x.com/android/forum/t...ceive-objects-over-the-network.34612/#content It is easier to connect from the PC to the Android. If you want to connect to the PC then you need to configure the firewall properly. Upvote 0
It is not related to AsyncStreamsObject. It is a network issue. Try this B4J + B4A example: https://www.b4x.com/android/forum/t...ceive-objects-over-the-network.34612/#content It is easier to connect from the PC to the Android. If you want to connect to the PC then you need to configure the firewall properly.
ValDog Active Member Licensed User Longtime User Nov 28, 2014 #3 Erel said: It is not related to AsyncStreamsObject. It is a network issue. Try this B4J + B4A example: https://www.b4x.com/android/forum/t...ceive-objects-over-the-network.34612/#content It is easier to connect from the PC to the Android. If you want to connect to the PC then you need to configure the firewall properly. Click to expand... Erel, that is the example I am using, and as you noted it is easier to connect from the PC to the Android. Does anyone have any hints they can share for configuring the firewall? Upvote 0
Erel said: It is not related to AsyncStreamsObject. It is a network issue. Try this B4J + B4A example: https://www.b4x.com/android/forum/t...ceive-objects-over-the-network.34612/#content It is easier to connect from the PC to the Android. If you want to connect to the PC then you need to configure the firewall properly. Click to expand... Erel, that is the example I am using, and as you noted it is easier to connect from the PC to the Android. Does anyone have any hints they can share for configuring the firewall?
Erel B4X founder Staff member Licensed User Longtime User Nov 30, 2014 #4 1. Temporary disable it and then try it to see whether the firewall is the problem. 2. http://windows.microsoft.com/en-us/windows/open-port-windows-firewall#1TC=windows-7 Upvote 0
1. Temporary disable it and then try it to see whether the firewall is the problem. 2. http://windows.microsoft.com/en-us/windows/open-port-windows-firewall#1TC=windows-7
ValDog Active Member Licensed User Longtime User Nov 30, 2014 #5 Erel said: 1. Temporary disable it and then try it to see whether the firewall is the problem. 2. http://windows.microsoft.com/en-us/windows/open-port-windows-firewall#1TC=windows-7 Click to expand... I temporarily disabled the Windows firewall, but still can't connect. Error I get is: (ErrnoException) libcore.io.ErrnoException: isConnected failed: ECONNREFUSED (Connection refused)." When the firewall is enabled and the port opened for TCP I get: "(SocketTimeoutException) java.net.SocketTimeoutException: failed to connect to /192.168.1.15 (port 32118) after 30000ms" followed by: "(ErrnoException) libcore.io.ErrnoException: fcntl failed: EBADF (Bad file number)" Any ideas? Upvote 0
Erel said: 1. Temporary disable it and then try it to see whether the firewall is the problem. 2. http://windows.microsoft.com/en-us/windows/open-port-windows-firewall#1TC=windows-7 Click to expand... I temporarily disabled the Windows firewall, but still can't connect. Error I get is: (ErrnoException) libcore.io.ErrnoException: isConnected failed: ECONNREFUSED (Connection refused)." When the firewall is enabled and the port opened for TCP I get: "(SocketTimeoutException) java.net.SocketTimeoutException: failed to connect to /192.168.1.15 (port 32118) after 30000ms" followed by: "(ErrnoException) libcore.io.ErrnoException: fcntl failed: EBADF (Bad file number)" Any ideas?
Erel B4X founder Staff member Licensed User Longtime User Dec 1, 2014 #6 Are you able to connect from the PC to the Android with this example? Upvote 0
ValDog Active Member Licensed User Longtime User Dec 1, 2014 #7 Erel said: Are you able to connect from the PC to the Android with this example? Click to expand... Yes - no problem. Upvote 0
Erel said: Are you able to connect from the PC to the Android with this example? Click to expand... Yes - no problem.
Erel B4X founder Staff member Licensed User Longtime User Dec 2, 2014 #8 Go over the code in the B4J example. You will see that it doesn't call ServerSocket.Listen. You will need to modify the code if you want to allow incoming connections. Upvote 0
Go over the code in the B4J example. You will see that it doesn't call ServerSocket.Listen. You will need to modify the code if you want to allow incoming connections.