• Post Reply Bookmark Topic Watch Topic
  • New Topic

Port 5000

 
Phil Hopgood
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Everyone,

I'm a newbie to Java and to sockets, so, please excuse the idiot questions.

I should say now that I have solved this problem BUT I don't think I fully understand so I would be glad of your comments. The area of doubt relates specifically to port 5000.

I've been working through the Head First Java book and got to the bit where they do a simple chat server.

The server was created thus:


and the client socket:


The server started ok but when I fired up the client it wouldn't connect giving the following error message:



After a lot of checking of the code I decided to change the port to 4242 as I'd already got an even simpler example working using that port.

Great this worked ok. So I concluded that there was something else bound to port 5000. I had a look on the web and came up with this:

Port Authority Database

Port 5000

Name: upnp-evnt
Purpose: Universal Plug N' Play Event
Description: This TCP port is opened and used by Universal Plug N' Play (UPnP) devices to accept incoming connections from other UPnP devices. UPnP devices connect to each other using TCP protocol over port 5000.
Related Ports: 1900


Made sense to me. Latterly I did a search on JavaRanch to see if others had had the same problem with port 5000 and, although some people did, the solutions given didn't involve changing the port to something other than 5000.

So I'm wondering if I've missed something here.

Have I? What do you think?

Thanks in advance for ploughing through all this.

Regards,
Phil.
 
Ulf Dittmer
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A quick search makes it look like the other issues mentioning port 5000 had to do with other problems, not with UPnP. Or maybe everyone else used source code written by someone who knew about that, and thus used a different port to begin with.
 
Phil Hopgood
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for that Ulf,

Yeah I thought that too but I just wanted to be sure that there wasn't some subtle underlying factor here that I was missing. Also I'm guessing that the reason why it was in the Head First book and thus not an issue is that the code was developed on a Mac and I'm assuming that Mac implements pnp differently - I'm using W2K and have no knowledge of Mac I'm afraid.

Thanks again,
Regards,
Phil.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!