New To Mac-Forums?

Welcome to our community! Join the discussion today by registering your FREE account. If you have any problems with the registration process, please contact us!

Get your questions answered by community gurus Advice and insight from world-class Apple enthusiasts Exclusive access to members-only contests, giveaways and deals

Join today!

Start a Discussion

Mac-Forums Brief

Subscribe to Mac-Forums Brief to receive special offers from Mac-Forums partners and sponsors

Join the conversation RSS
OS X - Development and Darwin Discussion and questions about development for Mac OS X.

Java Mac LINUX connection using sockets

Post Reply New Thread Subscribe

Thread Tools

Member Since: Jun 27, 2011
Location: Riverside CA
Posts: 15
shellback3 is on a distinguished road
Mac Specs: I've had an iMac for over a year and got an Air when the new ones came out several months ago.

shellback3 is offline
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

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.
QUOTE Thanks

Post Reply New Thread Subscribe

« Reading iTunes ITL file? | Org Chart »
Thread Tools

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off
Forum Jump

Similar Threads
Thread Starter
Last Post
Running Windows on a Mac: A Switcher's Guide cwa107 Running Windows (or anything else) on your Mac 293 12-27-2014 02:38 PM
Can't get bridged networking to work between linux guest virtual machine and Mac host gpsfreak OS X - Operating System 1 02-23-2012 10:00 AM
Triple boot 2 tiger installs and a linux install on a iBook G3 jharris1993 Running Windows (or anything else) on your Mac 15 02-10-2012 04:11 PM
Switching soon with a Mac Mini from Linux and Windows walkerj Switcher Hangout 7 02-14-2005 02:23 PM
Mac Users Get More ISP Choices schweb Apple Rumors and Reports 1 03-06-2003 10:57 AM

All times are GMT -4. The time now is 01:19 PM.

Powered by vBulletin
Copyright ©2000 - 2015, Jelsoft Enterprises Ltd.

Welcome to

Create your username to jump into the discussion!

New members like you have made this community the ultimate source for your Mac since 2003!

(4 digit year)

Already a member?