LAN strategy (Android)

  • Thread starter Dirk Bruere at NeoPax
  • Start date
D

Dirk Bruere at NeoPax

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

From: Dirk Bruere at NeoPax <[email protected]>

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
 
R

Roedy Green

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

To: Dirk Bruere at NeoPax
From: Roedy Green <[email protected]>

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)

-+- 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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

LAN strategy (Android) 1
Accessing a thread 2
multiple inheritance 5
Accessing a thread 5
Looking For program to send email 2
Accessing a thread 3
Looking For program to send email 0
new jdks 1.7.0_06 1.6.0_34 0

Members online

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,048
Latest member
verona

Latest Threads

Top