aspose file tools*
The moose likes Sockets and Internet Protocols and the fly likes Virtual Desktops and Sockets and Ports and Clients and Servers Question Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Sockets and Internet Protocols
Bookmark "Virtual Desktops and Sockets and Ports and Clients and Servers Question" Watch "Virtual Desktops and Sockets and Ports and Clients and Servers Question" New topic
Author

Virtual Desktops and Sockets and Ports and Clients and Servers Question

Matt Morrow
Greenhorn

Joined: Aug 12, 2014
Posts: 2
Hi,

I have a simple client/server application that I've run for years and years on different platforms (Redhat, Fedora, Windows 7, XP, etc.) and under different version-levels of

Java. The client and server threads (in this case, reminder-messages being displayed at the appropriate time) communicate via a port and socket.

The socket connection uses one of the available ports on that desktop machine.
(And that port number can be assigned to an environment variable or to an init file)

socket = new Socket(address, int-port-number);

And also, the address is not assigned or used.
It's just a new String().

I'm dragged kicking and screaming into the new age we all live in, and thrust into virtual desktops.
One is Windows and one is Linux, but neither can use a socket/port like this anymore.

Do I now need to use a COM-port-redirector/Virtual-serial-port like socat Project?

TIA, Matt
Henry Wong
author
Sheriff

Joined: Sep 28, 2004
Posts: 18896
    
  40

Matt Morrow wrote:
I have a simple client/server application that I've run for years and years on different platforms (Redhat, Fedora, Windows 7, XP, etc.) and under different version-levels of

Java. The client and server threads (in this case, reminder-messages being displayed at the appropriate time) communicate via a port and socket.

The socket connection uses one of the available ports on that desktop machine.
(And that port number can be assigned to an environment variable or to an init file)

socket = new Socket(address, int-port-number);

And also, the address is not assigned or used.
It's just a new String().

I'm dragged kicking and screaming into the new age we all live in, and thrust into virtual desktops.
One is Windows and one is Linux, but neither can use a socket/port like this anymore.

Do I now need to use a COM-port-redirector/Virtual-serial-port like socat Project?


First of all, there is no such a thing as a socket where "the address is not assigned or used". A socket communicates to a network address and port. A socket where the address is not used is like the post office trying to deliver mail without using the address.

Anyway, how does it work then? I am thinking that your previous systems were configured to use the loopback when the address is not specified. This is not the same as the address is not used -- what is happening is that the application specified null (or no address), and the naming server replaced it with an address. And in general, a loopback address is return in many cases.

So, what does this mean? Well, it could mean that the virtual systems are not configured to do that. It could also mean that that the systems are not configured with a loopback interface. For the first case, you can get around this issue by simply specifying the loopback address, instead of a blank string. For the second, you will need to talk to your system administrator to add the loopback interface.

Henry


Books: Java Threads, 3rd Edition, Jini in a Nutshell, and Java Gems (contributor)
Matt Morrow
Greenhorn

Joined: Aug 12, 2014
Posts: 2
Thanks. That answers it.
Henry Wong
author
Sheriff

Joined: Sep 28, 2004
Posts: 18896
    
  40

Matt Morrow wrote:Thanks. That answers it.


Glad to help. And welcome to the ranch.

Henry
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Virtual Desktops and Sockets and Ports and Clients and Servers Question