Football Fans: Download the 2012 Schedule App from Google Play!


Go Back   Android Forums > Android Development > Application Development > Developer 101

Developer 101 101 Tutorials



Reply
 
LinkBack Thread Tools
Old February 7th, 2012, 12:15 AM   #1 (permalink)
New Member
 
Join Date: Dec 2010
Posts: 6
 
Device(s):
Thanks: 6
Thanked 0 Times in 0 Posts
Default Socket networking

I'm trying to set up a basic network connection using droids but I'm having problems.

my server program:
Code:
ServerSocket ss = new ServerSocket(8888);
                while(!end){
                        //Server is waiting for client here, if needed
                        Socket s = ss.accept();
.....
Client program:
Code:
try {
            Socket s = new Socket(*my ip address*,8888);
.....
the server runs until it reaches ss.accept() like it should but the client still can't connect. The client usually times out and nothing happens

I'm running both these programs using eclipse on my computer. I set the premissions in the manifest for both programs to let them use the internet and I have the port forwarding so I don't think that's the problem either.

Can anyone help me?

reptile7383 is offline  
Reply With Quote
Sponsors
Old February 7th, 2012, 03:01 PM   #2 (permalink)
Senior Member
 
Join Date: Jul 2010
Posts: 977
 
Device(s): Samsung Galaxy S II, HTC Evo 4G, Amazon Kindle Fire
Thanks: 52
Thanked 199 Times in 144 Posts
Default

Are you providing the external IP address or are you providing the internal address?
jonbonazza is online now  
Reply With Quote
Old February 7th, 2012, 05:19 PM   #3 (permalink)
New Member
 
Join Date: Dec 2010
Posts: 6
 
Device(s):
Thanks: 6
Thanked 0 Times in 0 Posts
Default

External and I have my router set up to forward the port 8888 to my internal one. I've gotten this to work before when I was working with python code so I'm doubtful that it's my problem now.

Soon I'm going to try to get eclipse set up on my laptop and see if the two programs will connect when running on separate computers. I'm not sure if eclipse just doesn't like running to programs on the same computer.
reptile7383 is offline  
Reply With Quote
Reply

Bookmarks


Go Back   Android Forums > Android Development > Application Development > Developer 101 User CP
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -5. The time now is 08:26 PM.
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.
Custom vBulletin Skins by: Relivo