Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
The moose likes Sockets and Internet Protocols and the fly likes making client/server connection within the same network? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Sockets and Internet Protocols
Bookmark "making client/server connection within the same network?" Watch "making client/server connection within the same network?" New topic
Author

making client/server connection within the same network?

Aadesh Nguyen
Greenhorn

Joined: Jul 14, 2011
Posts: 3
Sorry if the title confused you. What I was wondering is whether there is a way to make a server/client connection using one computer without using "localhost"? I thought I could do it with VirtualBox, but the virtual machine and the host machine end up having the same IP address. If we could not do it with a computer, how about two computers but using the same network?

Thanks in advance,
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19790
    
  20

Aadesh Nguyen wrote:Sorry if the title confused you. What I was wondering is whether there is a way to make a server/client connection using one computer without using "localhost"? I thought I could do it with VirtualBox, but the virtual machine and the host machine end up having the same IP address. If we could not do it with a computer, how about two computers but using the same network?

Thanks in advance,

As far as Windows is concerned, the VirtualBox virtual machine is a different computer. In your case they share the same IP address because that's probably how you set them up. You can also use bridge-mode networking for the virtual machine, which means that the virtual machine will use the same physical network card as usual but will get a different IP address.
Because you now have the two machines share the same IP address, Windows has no way whatsoever of communication with the virtual machine through the network. If you try to connect to "localhost" or to the IP address, it will connect to itself.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: making client/server connection within the same network?