Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Socket Connection Problem

 
sam sawant
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

in my program
i want ipaddress & port number to be entered by the user in text fields. this values should passed to socket connection

what i did
ipaddress=tf1.gettext()
port_no.=tf2.gettext()

& then

Socket s=new socket(ipaddress,port_no);


but this doesn't work....so do help me out......
 
Ulf Dittmer
Rancher
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You didn't say how it doesn't work, but in any case there is no Socket (String, String) constructor. You need to use an int for the port number. If that's not the problem you're facing, TellTheDetails of what is the problem.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic