Android Question AsyncStreamsObject - Send and receive objects over the network

Discussion in 'Android Questions' started by dibesw, May 6, 2015.

  1. dibesw

    dibesw Active Member Licensed User

    is it always not possible this for 2 device or exist now a solution?
  2. Erel

    Erel Administrator Staff Member Licensed User

    I'm sorry but I don't understand the question.
    lemonisdead and Peter Simpson like this.
  3. dibesw

    dibesw Active Member Licensed User

    Sorry the request is:
    I have tested AsyncStreamObject for send and receive text and image from device to another device;
    If the device are in local network, this works well.
    but if the device are in internet connection (not in local network) this not longer works.
    is it possible to do something now?
  4. derez

    derez Expert Licensed User

  5. Peter Simpson

    Peter Simpson Expert Licensed User

    You need to setup port forwarding on your router if you are outside of the LAN...
  6. dibesw

    dibesw Active Member Licensed User

  7. derez

    derez Expert Licensed User

    Yes, but then both need to have a fix address like when using duckdns or similar service.
  8. dibesw

    dibesw Active Member Licensed User

    If I use this code:
    Dim hc As HttpClient

    Sub hc_ResponseSuccess(Response As HttpResponse, TaskId As Int)
        ipall.Text = 
    "Indirizzo IP: " & Response.GetString("UTF8")
    End Sub

    Sub hc_ResponseError(Response As HttpResponse, Reason As String, StatusCode As Int, TaskId As Int)
    Msgbox("Errore IP - "  & Response.GetString("UTF8"), "")
    End Sub
    Then I get a public IP address; can I use this IP address?
    It works if I use local address but not works if I use this public IP. Why?
    (I use AsyncStreams)
  9. DonManfred

    DonManfred Expert Licensed User

    Yes. This is the ip from the device calling this url.
    If you have devices A and B and A is calling this url. A knows the ip of itself now.
    B call the same url, get another IP. B is knowing the ip of itself now.

    But how do you realize that A know the IP of B and B knows the IP of A?
  10. dibesw

    dibesw Active Member Licensed User

    This IP can put into a web server, but this IP however it does not work.
    It works only local IP.
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice