I found that ServerSocket can't work in Android emulator.
When the Socket client is on a PC, the ServerSocket is on the
emulator, and the ServerSocket is binded with an ip address of the
machine running the emulator, the ServerSocket won't work.
What is the replacement solution since the latest version of Android
has not fixed this after 20071127?
Anyone can help me since the emulator must serve as a remote service?
you need to create a TCP or UDP redirection to let your client on the PC access the server on the emulated device. for example, if you connect to the emulator's control console, and type something like:
redir add tcp:5000:6000
this will redirect all connections to your PC's localhost:5000 towards the emulated localhost:6000
have a look at the emulator documentation for more details (or you could type "redir help" in the control console)
On Thu, Feb 28, 2008 at 9:25 AM, ken <keyes...@gmail.com> wrote:
> I found that ServerSocket can't work in Android emulator.
> When the Socket client is on a PC, the ServerSocket is on the > emulator, and the ServerSocket is binded with an ip address of the > machine running the emulator, the ServerSocket won't work.
> What is the replacement solution since the latest version of Android > has not fixed this after 20071127? > Anyone can help me since the emulator must serve as a remote service?
Thanks a lot for your help.
I have tried the "redir" command in the telnet, and I tested the
program in the same machine and the ServerSocket worked.
But after i ran my Client on other machines, the Android ip/port
couldn't be found. Does it mean that the Android's listening ip/port
can't be seen by another machine?
What could I do?
On Feb 28, 8:12 pm, Digit <digit.andr...@gmail.com> wrote:
> you need to create a TCP or UDP redirection to let your client on the PC
> access the server on the emulated device.
> for example, if you connect to the emulator's control console, and type
> something like:
> redir add tcp:5000:6000
> this will redirect all connections to your PC's localhost:5000 towards the
> emulated localhost:6000
> have a look at the emulator documentation for more details (or you could
> type "redir help" in the control console)
> On Thu, Feb 28, 2008 at 9:25 AM, ken <keyes...@gmail.com> wrote:
> > I found that ServerSocket can't work in Android emulator.
> > When the Socket client is on a PC, the ServerSocket is on the
> > emulator, and the ServerSocket is binded with an ip address of the
> > machine running the emulator, the ServerSocket won't work.
> > What is the replacement solution since the latest version of Android
> > has not fixed this after 20071127?
> > Anyone can help me since the emulator must serve as a remote service?
I have the same problem, i create a ServerSocket to port 2027, I
telnet to the emulator and execute "redir add tcp:2027:2027", i can
connect from localhost, but no from a remote host. It's not a firewall
issue because I turned it off for the test. I'm in a linux machine,
anyone has found a solution for this? Is it a bug?
On Mar 2, 3:46 am, ken <keyes...@gmail.com> wrote:
> Thanks a lot for your help.
> I have tried the "redir" command in the telnet, and I tested the
> program in the same machine and theServerSocketworked.
> But after i ran my Client on other machines, the Android ip/port
> couldn't be found. Does it mean that the Android's listening ip/port
> can't be seen by another machine?
> What could I do?
> On Feb 28, 8:12 pm, Digit <digit.andr...@gmail.com> wrote:
> > you need to create a TCP or UDP redirection to let your client on the PC
> > access the server on the emulated device.
> > for example, if you connect to the emulator's control console, and type
> > something like:
> > redir add tcp:5000:6000
> > this will redirect all connections to your PC's localhost:5000 towards the
> > emulated localhost:6000
> > have a look at the emulator documentation for more details (or you could
> > type "redir help" in the control console)
> > On Thu, Feb 28, 2008 at 9:25 AM, ken <keyes...@gmail.com> wrote:
> > > I found thatServerSocketcan't work in Android emulator.
> > > When the Socket client is on a PC, theServerSocketis on the
> > > emulator, and theServerSocketis binded with an ip address of the
> > > machine running the emulator, theServerSocketwon't work.
> > > What is the replacement solution since the latest version of Android
> > > has not fixed this after 20071127?
> > > Anyone can help me since the emulator must serve as a remote service?
> I have the same problem, i create a ServerSocket to port 2027, I
> telnet to the emulator and execute "redir add tcp:2027:2027", i can
> connect from localhost, but no from a remote host. It's not a firewall
> issue because I turned it off for the test. I'm in a linux machine,
> anyone has found a solution for this? Is it a bug?
> On Mar 2, 3:46 am, ken <keyes...@gmail.com> wrote:
> > Thanks a lot for your help.
> > I have tried the "redir" command in the telnet, and I tested the
> > program in the same machine and theServerSocketworked.
> > But after i ran my Client on other machines, the Android ip/port
> > couldn't be found. Does it mean that the Android's listening ip/port
> > can't be seen by another machine?
> > What could I do?
> > On Feb 28, 8:12 pm, Digit <digit.andr...@gmail.com> wrote:
> > > you need to create a TCP or UDP redirection to let your client on the PC
> > > access the server on the emulated device.
> > > for example, if you connect to the emulator's control console, and type
> > > something like:
> > > redir add tcp:5000:6000
> > > this will redirect all connections to your PC's localhost:5000 towards the
> > > emulated localhost:6000
> > > have a look at the emulator documentation for more details (or you could
> > > type "redir help" in the control console)
> > > On Thu, Feb 28, 2008 at 9:25 AM, ken <keyes...@gmail.com> wrote:
> > > > I found thatServerSocketcan't work in Android emulator.
> > > > When the Socket client is on a PC, theServerSocketis on the
> > > > emulator, and theServerSocketis binded with an ip address of the
> > > > machine running the emulator, theServerSocketwon't work.
> > > > What is the replacement solution since the latest version of Android
> > > > has not fixed this after 20071127?
> > > > Anyone can help me since the emulator must serve as a remote service?
> 1. Enter the Android tools path and run:
> adb forward tcp:2027 tcp:2027
> 2. Download a tool which named stcppipe and run:
> stcppipe.exe -b 192.168.0.85 127.0.0.1 2027 2027
> and you can run your application correctly now.
> Regards.
> On Apr 11, 4:02 am, Pipex <flala...@gmail.com> wrote:
> > I have the same problem, i create a ServerSocket to port 2027, I
> > telnet to the emulator and execute "redir add tcp:2027:2027", i can
> > connect from localhost, but no from a remote host. It's not a firewall
> > issue because I turned it off for the test. I'm in a linux machine,
> > anyone has found a solution for this? Is it a bug?
> > On Mar 2, 3:46 am, ken <keyes...@gmail.com> wrote:
> > > Thanks a lot for your help.
> > > I have tried the "redir" command in the telnet, and I tested the
> > > program in the same machine and theServerSocketworked.
> > > But after i ran my Client on other machines, the Android ip/port
> > > couldn't be found. Does it mean that the Android's listening ip/port
> > > can't be seen by another machine?
> > > What could I do?
> > > On Feb 28, 8:12 pm, Digit <digit.andr...@gmail.com> wrote:
> > > > you need to create a TCP or UDP redirection to let your client on the PC
> > > > access the server on the emulated device.
> > > > for example, if you connect to the emulator's control console, and type
> > > > something like:
> > > > redir add tcp:5000:6000
> > > > this will redirect all connections to your PC's localhost:5000 towards the
> > > > emulated localhost:6000
> > > > have a look at the emulator documentation for more details (or you could
> > > > type "redir help" in the control console)
> > > > On Thu, Feb 28, 2008 at 9:25 AM, ken <keyes...@gmail.com> wrote:
> > > > > I found thatServerSocketcan't work in Android emulator.
> > > > > When the Socket client is on a PC, theServerSocketis on the
> > > > > emulator, and theServerSocketis binded with an ip address of the
> > > > > machine running the emulator, theServerSocketwon't work.
> > > > > What is the replacement solution since the latest version of Android
> > > > > has not fixed this after 20071127?
> > > > > Anyone can help me since the emulator must serve as a remote service?