This week's book giveaway is in the
Agile and other Processes
forum.
We're giving away four copies of
The Mikado Method
and have Ola Ellnestam and Daniel Brolund on-line!
See
this thread
for details.
A friendly place for programming greenhorns!
Big Moose Saloon
Search
|
Java FAQ
|
Recent Topics
Register / Login
Win a copy of
The Mikado Method
this week in the
Agile and other Processes
forum!
JavaRanch
»
Java Forums
»
Java
»
Sockets and Internet Protocols
Author
java socket programming
nayomi gunawardena
Greenhorn
Joined: Sep 17, 2011
Posts: 6
posted
Sep 17, 2011 22:21:37
0
import
java.net.Socket
;
public class MyClient {
public static void main(
String
[] args) {
try {
Socket socket = new Socket("127.0.0.1", 20000);
} catch(Exception e) {
System.out.println(e.getMessage());
e.printStackTrace();
}
}
}
how to see what exception is thrown in the above code snippet??
Ulf Dittmer
Marshal
Joined: Mar 22, 2005
Posts: 35241
7
posted
Sep 18, 2011 01:53:41
1
Doesn't the "e.printStackTrace()" do that?
Android apps
–
ImageJ plugins
–
Java web charts
Rob Spoor
Sheriff
Joined: Oct 27, 2005
Posts: 19216
I like...
posted
Sep 18, 2011 07:43:17
0
It should, and otherwise there's still e.getClass().
SCJP 1.4 - SCJP 6 - SCWCD 5
How To Ask Questions
How To Answer Questions
nayomi gunawardena
Greenhorn
Joined: Sep 17, 2011
Posts: 6
posted
Sep 20, 2011 01:30:07
0
ok thanks
alot
guyzz
I agree. Here's the link:
http://ej-technologies/jprofiler
- if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
subject: java socket programming
Similar Threads
Help me out to solve the exception
NotSerializableException with java.net.Socket
Please help me out for the socket connection
Producer/Consumer Design impacts exception handling
Error in calling shutDownInput and shutDownOutput
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter