Java Mac LINUX connection using sockets

Joined
Jun 27, 2011
Messages
15
Reaction score
0
Points
1
Location
Riverside CA
Your Mac's Specs
I've had an iMac for over a year and got an Air when the new ones came out several months ago.
I'm finishing up a Java package that will provide communications among a few mostly headless computers on a LAN on an aircraft but I have only two LINUX boxes to use for testing. One is the "master" and the other a client. I thought that I would use my personal mac Air as another client to see if the system would work with more than one client but it has a point of failure. When either the LINUX master attempts to get the OS-X client name (Lion or Mountain Lion) or the client attempts to get the name of the master what I get is the respective computer's IP address. I use the computer name as a key in a map.

I'm fairly new to Java and quite new to sockets.

Here's the code. ipaddress and hostname are strings

Code:
try {  
              
     InetAddress machine = InetAddress.getByName(ipaddress);  
     hostName = machine.getHostName();  
} catch (UnknownHostException e) {  
    Tell.sendMessage("getRemoteHostName: host name lookup failed for " + ipaddress);  
                      
} catch (SecurityException e) {  
    Tell.sendMessage("getRemoteHostName: Security Exception: host name lookup failed for " + ipaddress);  
                      
}

My computers are all connected to a router none is a server.

I've had no response to this question on a Java forum so thought I would try here.

Edit: no exception is thrown or caught.
 

Shop Amazon


Shop for your Apple, Mac, iPhone and other computer products on Amazon.
We are a participant in the Amazon Services LLC Associates Program, an affiliate program designed to provide a means for us to earn fees by linking to Amazon and affiliated sites.
Top