I am using the iNetwork library to receive connections from external clients.
B4X:
Do While True
Serv.Listen
Wait For Serv_NewConnection (Successful As Boolean, NewSocket As Socket)
If Successful Then
astream.Initialize(NewSocket.InputStream,NewSocke.OutputStream,"astream")
log("ip")
End If
Loop
But I would like to know the IP address of the clients, what can I do?
I've updated the library.
You can now get the host and port:
B4X:
Sub Server_NewConnection (Successful As Boolean, NewSocket As Socket)
Dim no As NativeObject = NewSocket
Log(no.GetField("socket").GetField("host").AsString)
Log(no.GetField("socket").GetField("port").AsString)
End Sub
The updated internal library will be included in the next version of B4i. It was already uploaded to the hosted builders.