B4A Library [B4X] FTP Server implemented with Socket and AsyncStreams

dibesw

Active Member
Licensed User
Longtime User
Has anyone ever used this item?
B4X:
server.ForcedServerIp = "192.168.xxx.xxx"
I have an FTP server.
I understand that I can force the IP code but it doesn't work (code IP is always random).
Can I force the IP code myself?
 
Last edited:

dibesw

Active Member
Licensed User
Longtime User
What is exactly the problem that you are trying to solve?
B4X:
Private Sub B4XPage_Created (Root1 As B4XView)
    Root = Root1
    Root.LoadLayout("MainPage")
    server.Initialize(Me, "FTPServer")
    'server.ForcedServerIp = "192.168.100.10" 'local access
    Label1.Text = $"IL MIO IP: ${server.ssocket.GetMyWifiIP}"$
    server.SetPorts(51041, 51042, 51142)
    server.AddUser("sms", "paziente")
    server.BaseDir=File.DirInternal
    server.Start   
End Sub

I have an FTP server in my smartphone and simply know if it is possible to give a fixed IP code or the code is random:
B4X:
server.ssocket.GetMyWifiIP
I found this item
B4X:
server.ForcedServerIp = "192.168.xxx.xxx"
and I thought you could force the IP code but that's not the case
 

OliverA

Expert
Licensed User
Longtime User
and I thought you could force the IP code but that's not the case
Is the IP address the (or one of the) addresses assigned to the phone? If not, it's tough to assign a non-existing (non-assigned to the phone) IP address on Android. You are running into a limitation enforced upon you by the phone, not by B4A and/or server.ForcedServerIp.
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…