Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / January 2006

Tip: Looking for answers? Try searching our database.

IP Address of PCs connected to my machine

Thread view: 
crash.test.dummy - 26 Jan 2006 16:58 GMT
Hi,
  I have a Swing application (running on PC1) that listens on a
specific port, but its not tied up to a particular machine, so any
machine "can connect" to PC1. It is like a chatroom application that
anyone can join in and send and receive messages (except that I'm not
running on the web).

  With this, how do I know the  IP addresses (LAN/WAN/frame relay) of
the machines connected to PC1?

Thanks for your help.
Gordon Beaton - 26 Jan 2006 17:16 GMT
>    I have a Swing application (running on PC1) that listens on a
> specific port, but its not tied up to a particular machine, so any
[quoted text clipped - 4 lines]
>    With this, how do I know the  IP addresses (LAN/WAN/frame relay) of
> the machines connected to PC1?

Ask the sockets corresponding to each connection you've accepted().
Socket.getInetAddress() is what you are looking for.

/gordon

Signature

[  do not email me copies of your followups  ]
g o r d o n + n e w s @  b a l d e r 1 3 . s e

crash.test.dummy - 26 Jan 2006 19:11 GMT
I'll try this one. Thanks a lot!
Tail_Spin - 29 Jan 2006 00:10 GMT
How about:

InetAddress a = InetAddress.getByName( "some_url_arg" );

> >    I have a Swing application (running on PC1) that listens on a
> > specific port, but its not tied up to a particular machine, so any
[quoted text clipped - 13 lines]
> [  do not email me copies of your followups  ]
> g o r d o n + n e w s @  b a l d e r 1 3 . s e
Gordon Beaton - 30 Jan 2006 08:06 GMT
> How about:
>
> InetAddress a = InetAddress.getByName( "some_url_arg" );

That would seem to assume that you already know who is connected,
which I believe was the original question.

/gordon

Signature

[  do not email me copies of your followups  ]
g o r d o n + n e w s @  b a l d e r 1 3 . s e

Tail_Spin - 31 Jan 2006 09:24 GMT
hehehe, just ckeck'n to make sure someone is really paying attention

> > How about:
> >
[quoted text clipped - 8 lines]
> [  do not email me copies of your followups  ]
> g o r d o n + n e w s @  b a l d e r 1 3 . s e


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.