C ckoehn Banned Sep 21, 2011 #1 Why does this give me a "java.net.SocketException: The socket argument is not a valid file descriptor" Code: Copy If FirstTime Then nPort=edtPort.Text 'editbox = nPort is an int sIP=edtIP.Text 'editbox sIP is a string holding an IP address Socket1.Connect(sIP,nPort,20000) Activity.Title="AquaTECH System - Disconnected" End If I'm new to android programming. added: I even tried this and received the same error: Code: Copy Socket1.Initialize("Socket1") Socket1.Connect("169.254.1.1" , 2000, 20000) If a network is not connected, is that what makes that error occur? Thanks, Clint Last edited: Sep 22, 2011
Why does this give me a "java.net.SocketException: The socket argument is not a valid file descriptor" Code: Copy If FirstTime Then nPort=edtPort.Text 'editbox = nPort is an int sIP=edtIP.Text 'editbox sIP is a string holding an IP address Socket1.Connect(sIP,nPort,20000) Activity.Title="AquaTECH System - Disconnected" End If I'm new to android programming. added: I even tried this and received the same error: Code: Copy Socket1.Initialize("Socket1") Socket1.Connect("169.254.1.1" , 2000, 20000) If a network is not connected, is that what makes that error occur? Thanks, Clint
Erel B4X founder Staff member Licensed User Longtime User Sep 22, 2011 #2 This code looks fine: Code: Copy Socket1.Initialize("Socket1") Socket1.Connect("169.254.1.1" , 2000, 20000) Make sure that you are not trying to open the same IP / port multiple times. Please post the complete project if you do not find the problem. Upvote 0
This code looks fine: Code: Copy Socket1.Initialize("Socket1") Socket1.Connect("169.254.1.1" , 2000, 20000) Make sure that you are not trying to open the same IP / port multiple times. Please post the complete project if you do not find the problem.
C ckoehn Banned Sep 22, 2011 #3 Thanks Erel for your reply. I WAS trying to open the port multiple times it looked like. The first error that occurred said "Socket not connected" or something like that. I used your Network example as a base and was able to go from a Pandigital tablet to my computer with the tablet as the server. But I'm not able to set the tablet as a client and the computer as a server. I am using a tcp2com and a com2tcp with a Brays terminal. It works great with the tablet as a server. I eventually want to use this http://serialio.com/support/wifi/WiSnap_User_Guide_2.21.1.pdf (I'm actually using the WiSnap Standard Dongle for Wavetrend L-RX300) for a wireless connection to the tablet for data acquisition and control. Can it be made to work? Thanks for your help, Clint Upvote 0
Thanks Erel for your reply. I WAS trying to open the port multiple times it looked like. The first error that occurred said "Socket not connected" or something like that. I used your Network example as a base and was able to go from a Pandigital tablet to my computer with the tablet as the server. But I'm not able to set the tablet as a client and the computer as a server. I am using a tcp2com and a com2tcp with a Brays terminal. It works great with the tablet as a server. I eventually want to use this http://serialio.com/support/wifi/WiSnap_User_Guide_2.21.1.pdf (I'm actually using the WiSnap Standard Dongle for Wavetrend L-RX300) for a wireless connection to the tablet for data acquisition and control. Can it be made to work? Thanks for your help, Clint
Erel B4X founder Staff member Licensed User Longtime User Sep 23, 2011 #4 The problem with setting the computer as the server is that your firewall blocks the incoming connections. Disable the firewall and it should work. Upvote 0
The problem with setting the computer as the server is that your firewall blocks the incoming connections. Disable the firewall and it should work.