Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #16689 > unrolled thread

LAN strategy (Android)

Started byDirk Bruere at NeoPax <dirk.bruere@gmail.com>
First post2012-07-31 00:02 +0100
Last post2012-07-31 04:23 -0700
Articles 2 — 2 participants

Back to article view | Back to comp.lang.java.programmer


Contents

  LAN strategy (Android) Dirk Bruere at NeoPax <dirk.bruere@gmail.com> - 2012-07-31 00:02 +0100
    Re: LAN strategy (Android) Roedy Green <see_website@mindprod.com.invalid> - 2012-07-31 04:23 -0700

#16689 — LAN strategy (Android)

FromDirk Bruere at NeoPax <dirk.bruere@gmail.com>
Date2012-07-31 00:02 +0100
SubjectLAN strategy (Android)
Message-ID<a7oi3eFi35U1@mid.individual.net>
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

[toc] | [next] | [standalone]


#16703

FromRoedy Green <see_website@mindprod.com.invalid>
Date2012-07-31 04:23 -0700
Message-ID<inff18lbn371lpdto7punh4lkgpm3aqeir@4ax.com>
In reply to#16689
On Tue, 31 Jul 2012 00:02:25 +0100, Dirk Bruere at NeoPax
<dirk.bruere@gmail.com> 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

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.java.programmer


csiph-web