Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Java Networking

Reply
Thread Tools

Java Networking

 
 
Neo
Guest
Posts: n/a
 
      09-16-2006
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.

 
Reply With Quote
 
 
 
 
Lothar Kimmeringer
Guest
Posts: n/a
 
      09-16-2006
Neo wrote:

> 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
--
Lothar Kimmeringer E-Mail: http://www.velocityreviews.com/forums/(E-Mail Removed)
PGP-encrypted mails preferred (Key-ID: 0x8BC3CD81)

Always remember: The answer is forty-two, there can only be wrong
questions!
 
Reply With Quote
 
 
 
 
Martin Gregorie
Guest
Posts: n/a
 
      09-16-2006
Neo wrote:
> 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.
>

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.


--
martin@ | Martin Gregorie
gregorie. | Essex, UK
org |
 
Reply With Quote
 
Neo
Guest
Posts: n/a
 
      09-16-2006

Martin Gregorie wrote:
> Neo wrote:
> > 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.
> >

> 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?

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

 
Reply With Quote
 
Knute Johnson
Guest
Posts: n/a
 
      09-16-2006
Neo wrote:
> Martin Gregorie wrote:
>> Neo wrote:
>>> 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.
>> >

>> 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?

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


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 .

--

Knute Johnson
email s/nospam/knute/
 
Reply With Quote
 
 
 
Reply

Thread Tools

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Internet networking , group networking,business leads,new business opportunities,like having many sales peoples elie Computer Support 0 08-18-2007 10:12 AM
networking two pc together with wireless networking ? Andy Wireless Networking 4 02-26-2007 06:02 PM
PROBLEMS WITH NETWORKING - NEW TO NETWORKING =?Utf-8?B?QUJTUE9QVVA=?= Wireless Networking 2 03-23-2005 08:31 AM
[Reminder] Online chat with Networking & Devices VP about Networking in Longhorn Eddy Malik [MSFT] Wireless Networking 0 03-22-2005 03:27 AM
networking 2 pc with a networking hub and 1 internet connection barry crowley Computer Support 20 02-27-2004 05:09 AM



Advertisments