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 / September 2006

Tip: Looking for answers? Try searching our database.

Java Networking

Thread view: 
Neo - 16 Sep 2006 10:25 GMT
Hello
I have written a program in java in which there are two classes
Server(Server Socket) & Client(Socket). My question is that when I
create a server socket on my computer, client from any part of the
world who knows my IP address and port no. can connect to that server
socket. if not then what is the appropriate solution for them residing
anywhere on the globe.
Please any kind of help is really appreciated. I am really in trouble.
Thanks.
Lothar Kimmeringer - 16 Sep 2006 11:24 GMT
> My question is that when I
> create a server socket on my computer, client from any part of the
> world who knows my IP address and port no. can connect to that server
> socket.

Depends. You can bind your ServerSocket to a specific network
that might be restricted only to your local network (127.0.0.1
for example). The access to your ServerSocket might also be
restricted by firewalls or other techniques.

So your question can't be answered simply by yes or no, but if
you open a ServerSocket without specifying an IP-address, the
ServerSocket itself is accepting connections coming from all
network-interfaces. If your clients can reach these interfaces
you have to check in addition to that.

> if not then what is the appropriate solution for them residing
> anywhere on the globe.

Not sure what you mean, maybe you should question again in a
more detailed manner, especially what you want to be able to
do with your application.

Regards, Lothar
Signature

Lothar Kimmeringer                E-Mail: spamfang@kimmeringer.de
              PGP-encrypted mails preferred (Key-ID: 0x8BC3CD81)

Always remember: The answer is forty-two, there can only be wrong
                questions!

Martin Gregorie - 16 Sep 2006 11:30 GMT
> Hello
> I have written a program in java in which there are two classes
[quoted text clipped - 3 lines]
> socket. if not then what is the appropriate solution for them residing
> anywhere on the globe.

So what happened when you tried connecting to it:
- from another process on your computer?
- from another computer on your network?
- from a friend's computer?

Come back here when you've tried this.

Signature

martin@   | Martin Gregorie
gregorie. | Essex, UK
org       |

Neo - 16 Sep 2006 17:26 GMT
> > Hello
> > I have written a program in java in which there are two classes
[quoted text clipped - 8 lines]
> - from another computer on your network?
> - from a friend's computer?
I have tried in my own computer. It works fine. I have tried on LAN it
worked fine. Now question is that if i try in on a friend computer or i
give you my client program and you run on your pc where ever you are
Will Client and Server be connected. Please help me.|
Knute Johnson - 16 Sep 2006 18:38 GMT
>>> Hello
>>> I have written a program in java in which there are two classes
[quoted text clipped - 12 lines]
> give you my client program and you run on your pc where ever you are
> Will Client and Server be connected. Please help me.|

Yes if there are no firewalls or other restrictions in the way, the
client, knowing your IP address and the correct port, may connect from
anywhere on the net.  That's how it works :-).

Signature

Knute Johnson
email s/nospam/knute/



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.