This week's book giveaway is in the Design forum.
We're giving away four copies of Design for the Mind and have Victor S. Yocco on-line!
See this thread for details.
Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Socket constructor error

 
justin mcsporran
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
When I compile the appended class, I get the following error:

The code is:

Thanks in advance for any help,
Justin
 
Michael Morris
Ranch Hand
Posts: 3451
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
java.net.Socket does not have a constructor that accepts two Strings for host and port. It does have a constructor that accepts a String host and int port. So change

to

and it should work.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic