LAN strategy (Android)

Discussion in 'Java' started by Dirk Bruere at NeoPax, Jul 31, 2012.

  1. From: "Dirk Bruere at NeoPax" <dirk.bruere.at.neopax@1:261/38.remove-dpk-this>

    From: Dirk Bruere at NeoPax <>

    What's the best way to do this?

    I have to read from a LAN using UDP. I open a socket by doing a name lookup
    (the name of a PC I want to connect to) and port number as the app starts.

    In a thread I loop around reading the socket for messages and act on them.

    The problem is what do I do if I cannot access the LAN on startup and so miss
    getting the name/address? As far as I can see the app sits there doing nothing
    even if the LAN becomes available.

    Alternatively, do I put the name/address lookup in the thread loop, and if so,
    how?


    --
    Dirk

    Full Spectrum Praxis : ZERO STATE : http://zerostate.net

    -+- BBBS/Li6 v4.10 Dada-1
    + Origin: Prism bbs (1:261/38)
    -+- Synchronet 3.16a-Win32 NewsLink 1.98
    Time Warp of the Future BBS - telnet://time.synchro.net:24

    --- BBBS/Li6 v4.10 Dada-1
    * Origin: Prism bbs (1:261/38)
    --- Synchronet 3.16a-Win32 NewsLink 1.98
    Time Warp of the Future BBS - telnet://time.synchro.net:24
     
    Dirk Bruere at NeoPax, Jul 31, 2012
    #1
    1. Advertisements

  2. Dirk Bruere at NeoPax

    Roedy Green Guest

    To: Dirk Bruere at NeoPax
    From: "Roedy Green" <roedy.green@1:261/38.remove-dpk-this>

    To: Dirk Bruere at NeoPax
    From: Roedy Green <>

    On Tue, 31 Jul 2012 00:02:25 +0100, Dirk Bruere at NeoPax
    <> wrote, quoted or indirectly quoted someone who
    said :

    >What's the best way to do this?


    get the book with the three trains on the cover. See
    http://mindprod.com/jgloss/thread.html

    use
    import java.util.concurrent.BlockingQueue; import
    java.util.concurrent.ConcurrentHashMap; import
    java.util.concurrent.LinkedBlockingQueue; import
    java.util.concurrent.Semaphore; import java.util.concurrent.ThreadPoolExecutor;
    --
    Roedy Green Canadian Mind Products
    http://mindprod.com
    The greatest shortcoming of the human race is our inability to understand the
    exponential function.
    ~ Dr. Albert A. Bartlett (born: 1923-03-21 age: 89)
    http://www.youtube.com/watch?v=F-QA2rkpBSY

    -+- BBBS/Li6 v4.10 Dada-1
    + Origin: Prism bbs (1:261/38)
    -+- Synchronet 3.16a-Win32 NewsLink 1.98
    Time Warp of the Future BBS - telnet://time.synchro.net:24

    --- BBBS/Li6 v4.10 Dada-1
    * Origin: Prism bbs (1:261/38)
    --- Synchronet 3.16a-Win32 NewsLink 1.98
    Time Warp of the Future BBS - telnet://time.synchro.net:24
     
    Roedy Green, Jul 31, 2012
    #2
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Anthony Papillion

    Python on Android Mobile?

    Anthony Papillion, Jun 13, 2010, in forum: Python
    Replies:
    4
    Views:
    1,284
    geremy condra
    Jun 14, 2010
  2. Neredbojias
    Replies:
    1
    Views:
    718
    Neredbojias
    Jul 16, 2010
  3. Chris C.
    Replies:
    0
    Views:
    362
    Chris C.
    Aug 10, 2010
  4. Dirk Bruere at NeoPax

    Android LAN access problem

    Dirk Bruere at NeoPax, Mar 10, 2011, in forum: Java
    Replies:
    50
    Views:
    6,375
    Jinja
    Aug 22, 2011
  5. Stef Mientki
    Replies:
    0
    Views:
    836
    Stef Mientki
    Nov 27, 2011
  6. Dirk Bruere at NeoPax

    LAN strategy (Android)

    Dirk Bruere at NeoPax, Jul 31, 2012, in forum: Java
    Replies:
    1
    Views:
    319
    Roedy Green
    Jul 31, 2012
  7. Dirk Bruere at NeoPax

    LAN strategy (Android)

    Dirk Bruere at NeoPax, Jul 31, 2012, in forum: Java
    Replies:
    1
    Views:
    271
    Roedy Green
    Jul 31, 2012
  8. sterta bole
    Replies:
    0
    Views:
    1,169
    sterta bole
    Aug 27, 2012
Loading...