Two Laptop Bag
The moose likes Sockets and Internet Protocols and the fly likes Sockets Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Sockets and Internet Protocols
Bookmark "Sockets" Watch "Sockets" New topic


maya jain

Joined: Feb 22, 2011
Posts: 5

I am doing a client server program, The program works on the same computer (localhost), but if I give the name of another computer "MAYA-PC" I am getting the following error MAYA-PC
at Source)
at Source)
at Source)
at Source)
at<init>(Unknown Source)
at<init>(Unknown Source)
at type1.<init>(
at type1.keys(
at type1.access$0(
at type1$
at java.awt.event.InvocationEvent.dispatch(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForHierar chy(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarch y(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at Source)

why is this happening. Both the computers are connected to the same network

But on my computer MAYA-PC, which have both client and server program, even if I give socket = new Socket("MAYA-PC", 7777);....I am getting output. I thought that it may be a network problem and tried working client and server programs on different computers on another network too. But I got the same error.

Please Help me.

Swastik Dey

Joined: Jan 08, 2009
Posts: 1579

Instead of name, if you use IP address does it work?

I agree. Here's the link:
subject: Sockets
jQuery in Action, 3rd edition