problem in tcp socket code from separate machines

Problems with WiFi, SQLite ,Bluetooth, WiMax, Proxies, etc...

problem in tcp socket code from separate machines

Postby java_android » Fri Nov 06, 2009 5:07 am

Hi ,
I am running java server socket code on 4747 port on my machine .
and running client socket code in android emulator on different machine .

now client code on android emulator also created tcp socket on which server socket on my machine will send respose.client is listening on 4748.

when i run client it sends message to my server and i get it in server but when server tries to connect to client socket its giving me "connect refused" exception.

my machines behind firewall in our LAN , adb forword worked for me when i ran both programs on localhost . but for 2 diffrent machines its not working.

I also tried stcppipe.exe but maybe as i dont have public ip , its not working.
I can see client listening on port 4748 using "netstat -a" but my server cant connect to that port in client's machine .

i have tried with direct machines IP address(10.11.X.X ) while creating sockets .
even tried giving emulators " 10.0.2.2" or "10.0.2.15" address in client program. but nothing worked.
anybody has got solution to this problem ? any pointers will be really helpful.

-satish
java_android
Junior Developer
Junior Developer
 
Posts: 12
Joined: Thu Nov 06, 2008 12:30 pm

Top

got solution

Postby java_android » Mon Nov 09, 2009 11:37 am

Hi guys ,
and the solution is http://www.boutell.com/rinetd/
used this exe for port forwording make config file there and it works like charm .
before this you also have to redir you listeing port using adb.(adb redir tcp:port:port)

-satish
java_android
Junior Developer
Junior Developer
 
Posts: 12
Joined: Thu Nov 06, 2008 12:30 pm

Top

Return to Networking & Database Problems

Who is online

Users browsing this forum: Google Feedfetcher and 2 guests