Hi,

No sure that will work if both emulators have the same IP address.

I'd try running server & client programs in the same emulator. For the 
server use any port number between 1025 & 65535 that is not already used, 
ports below 1024 are generally reserve in linux/unix system & need su 
rights.  

Regards

On Friday, October 5, 2012 5:54:45 PM UTC+10, Archana wrote:
>
> Hi, I need to create an application(using 2 emulators) in which: Each 
> emulator serves as a server and a client.
>
> Server starts as a service in background. On request by the client, I have 
> to transfer the contents of a JSON file from 1 emulator's server to other 
> emulator's client.. Can you please guide me in the usage of how to use port 
> numbers(as the IP addresses of both instances of the emulator is the same)?
>
> Thank you!
>
> On Friday, October 5, 2012 5:48:19 AM UTC+3, gjs wrote:
>>
>> Hi,
>>
>> Change the port number in your request -
>>
>> PORT = 8765
>>
>> not 8080
>>
>> And yes you can write your own http server simply by using a server 
>> socket. 
>> http://docs.oracle.com/javase/tutorial/networking/sockets/clientServer.html
>>
>> Regards 
>>
>>
>> On Thursday, October 4, 2012 3:57:58 PM UTC+10, Archana wrote:
>>>
>>> Hi, I want to develop HTTP server in Android. I used the link 
>>> https://gist.github.com/1893396#gistcomment-582451 NanoHTTPD. But when 
>>> I open the page http://10.0.2.15:8080, I am getting WebPage not found. 
>>> In the logs, I am getting 
>>>
>>> 10-04 05:55:39.106: E/Tab(499): onReceivedError -6 
>>> http://10.0.2.15:8697/ The connection to the server was unsuccessful.
>>>
>>> Can anyone please tell me what the error is about? Or is there any other 
>>> way to implement a HTTP server in Android?
>>>
>>> Thanks in advance!
>>>
>>>

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to