Socket error

ckoehn

Banned
Why does this give me a "java.net.SocketException: The socket argument is not a valid file descriptor"

B4X:
    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:
B4X:
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:

ckoehn

Banned
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
Top