Android-dev.it Community

 
Annunci

:arrow: Benvenuto!, se non sei ancora un utente registrato: puoi registrati qui, oppure effettua il login
:arrow: Apri un forum sul tuo nuovo smartphone Android e collabora con noi! (dettagli)

www.agendadigitale.org
Image


Sponsor
It is currently Tue May 22, 2012 8:00 am

All times are UTC + 1 hour


 Topics   Replies   Views   Last post 
No new posts На интернет-витрине

by popowahgjfghjoiuyt on Sat May 19, 2012 2:25 pm in Amministrazione

0

12

Sat May 19, 2012 2:25 pm

popowahgjfghjoiuyt

No new posts Apri un forum sul tuo nuovo smartphone Android!

[ Go to page: 1, 2, 3 ]

by ReattileGar on Fri May 18, 2012 5:27 pm in Amministrazione

27

12514

Fri May 18, 2012 5:27 pm

ReattileGar

No new posts Новый: базы для хрумера - профессиональный софт для СЕО.

by Renatafe on Fri May 18, 2012 3:14 pm in Amministrazione

0

17

Fri May 18, 2012 3:14 pm

Renatafe

No new posts Pace is undoubtedly the vital affordable Jerseys Wholesale d

by barnettmmolive2012 on Wed May 16, 2012 7:36 am in Amministrazione

1

47

Wed May 16, 2012 7:36 am

barnettmmolive2012

No new posts with all of the association that congenita

by ienae on Tue May 15, 2012 4:55 am in Android

0

15

Tue May 15, 2012 4:55 am

ienae




Post new topic Reply to topic  [ 16 posts ]  Go to page Previous  1, 2
Author Message
 Post subject: Re: Comunicazione tra emulatori
PostPosted: Thu Nov 04, 2010 12:45 pm 
Offline
User avatar

Joined: Tue Jun 08, 2010 10:55 am
Posts: 15
Punti Android: ?
- Si, l'eccezione sul client viene lanciata dalla riga di codice

Code:
socket = new Socket(addr, 8887);


- L'app sul client ha i permessi di accedere ad Internet

- Il server non risponde

Code:
telnet 160.97.25.82 8887
Trying 160.97.25.82...
telnet: Unable to connect to remote host: Connection refused


Però riesco a pingare la macchina!

Deborah

PS. Grazie :) è bella, peccato che poco valorizzata!


Top
 Profile  
 
 Post subject: Re: Comunicazione tra emulatori
PostPosted: Thu Nov 04, 2010 2:28 pm 
Offline
User avatar

Joined: Thu Dec 27, 2007 7:09 pm
Posts: 659
Cellulare Android: HTC Dream
Operatore: TIM
Punti Android: 758
Sì ok, se riesci a pingare il server ma ti dà "connection refused" significa che sulla porta 8887 non c'è il server in ascolto.
- verifica che la riga di codice sull'app server
Code:
serverSocket = new ServerSocket(8080);

non lanci qualche eccezione.
Altrimenti prova dal Server con Linux a dare il comando:
Code:
nc -l 8887

Questa istruzione mette netcat direttamente in ascolto sulla porta 8887 del Server, quindi una volta fatto questo, sia il telnet dal PC client sia il tuo client sull'emulatore dovrebbero riuscire a connettersi alla porta 8887 del Server.

_________________
***URLs are hidden from guests, please register and login to view the hyperlink***


Top
 Profile  
 
 Post subject: Re: Comunicazione tra emulatori
PostPosted: Fri Nov 05, 2010 11:11 am 
Offline
User avatar

Joined: Tue Jun 08, 2010 10:55 am
Posts: 15
Punti Android: ?
Cari Verix e Barban... questa notte ho avuto un'illuminazione e ora i due emulatori comunicano!
Vi ringrazio entrambi perchè senza i vostri suggerimenti non ce l'avrei mai fatta :tleft: :tleft:
Allora la soluzione è questa:
Non ho usato ipTables ma redir, programma molto più semplice da usare!
Sul Server:
Code:
redir --lport=8887 --cport=8888

e poi:
Code:
telnet localhost 5554
redir add tcp:8888:8080

Sul Client:
Code:
redir --laddr=127.0.0.1 --lport=8887 --caddr=160.97.25.82 --cport=8887

è necessario fare la redirezione anche sul client perchè l'emulatore comunica solo con localhost :a2: questa è l'illuminazione
Grazie mille dinuovo.
Ciao
Deborah


Top
 Profile  
 
 Post subject: Re: [RISOLTO]Comunicazione tra emulatori
PostPosted: Sat Nov 06, 2010 3:07 pm 
Offline
Moderatore
User avatar

Joined: Thu Dec 27, 2007 3:51 pm
Posts: 986
Cellulare Android: HTC Dream
Operatore: TIM
Punti Android: 1320
Bene! Complimenti!
A dir la verità non sono sicurissimo che la redirezione delle porte sul client sia strettamente necessaria (mentre sul server sicuramente lo è perchè il redir dell'emulatore Android funziona solo con localhost), comunque l'importante è che funzioni!
Stai facendo qualche lavoro su Android per l'università ?
Buono studio..


Top
 Profile  
 
 Post subject: Re: [RISOLTO]Comunicazione tra emulatori
PostPosted: Sat Nov 06, 2010 5:52 pm 
Offline
User avatar

Joined: Tue Jun 08, 2010 10:55 am
Posts: 15
Punti Android: ?
Si, è il mio lavoro di tesi!
Ciao :)


Top
 Profile  
 
 Post subject: Re: [RISOLTO]Comunicazione tra emulatori
PostPosted: Sat Nov 06, 2010 5:56 pm 
Offline
Moderatore
User avatar

Joined: Thu Dec 27, 2007 3:51 pm
Posts: 986
Cellulare Android: HTC Dream
Operatore: TIM
Punti Android: 1320
Bè, allora non dimenticare di pubblicizzare il tuo lavoro qui, dopo averlo terminato :)
ciao!


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 16 posts ]  Go to page Previous  1, 2

All times are UTC + 1 hour


Who is online

Users browsing this forum: Google [Bot] and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
SitemapIndex SitemapIndex RSS Feed RSS Feed Channel list Channel list
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
phpBB SEO

All trademarks and logos used in this site are of properties of their respective owners.