• 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.
 
Consider Paul's rocket mass heater.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic