Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within Android
Search Coderanch
Advance search
Google search
Register / Login
Post Reply
Bookmark Topic
Watch Topic
New Topic
programming forums
Java
Mobile
Certification
Databases
Caching
Books
Engineering
Micro Controllers
OS
Languages
Paradigms
IDEs
Build Tools
Frameworks
Application Servers
Open Source
This Site
Careers
Other
Pie Elite
all forums
this forum made possible by our volunteer staff, including ...
Marshals:
Campbell Ritchie
Jeanne Boyarsky
Ron McLeod
Paul Clapham
Liutauras Vilda
Sheriffs:
paul wheaton
Rob Spoor
Devaka Cooray
Saloon Keepers:
Stephan van Hulst
Tim Holloway
Carey Brown
Frits Walraven
Tim Moores
Bartenders:
Mikalai Zaikin
Forum:
Android
Sockets Problem
Pedro Neves
Ranch Hand
Posts: 64
posted 11 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Hello. I'm having some problems with sockets
PORT = PORTEt.getText().toString(); IP = IPEt.getText().toString(); try { ss+= "Connecting to: " + IP + " :" + PORT; ConnectORDONT.setText(ss); int POR = Integer.parseInt(PORT); s = new Socket(IP, POR); //Calls another Activity Intent intent = new Intent(); intent.setClass(this,PrincipalActivity.class); intent.putExtra("IP",IP); intent.putExtra("PORT",PORT); startActivity(intent); s.close(); this.finish(); // close the activity } //tests if it can connect catch (NumberFormatException e) // handles the exceptions { e.printStackTrace(); ConnectORDONT.setText("Please enter the ip address and port address correctly!"); } catch (UnknownHostException e) { e.printStackTrace(); ConnectORDONT.setText("Address or port not found!"); } catch (IOException e) { e.printStackTrace(); ConnectORDONT.setText("Error, Openning Socket!"); }
when i try to connect to an IP the IOException is generated. I've already cheked and i have connectivity to the machine, i just can't connect througth the socket.
thanks in advance
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
Socket Java outputStream
IPAddress and Port
Creating a Pipe that connects 2 sockets
Passing my object to one to other activity
connection refused
More...