A
alessandro
Hi, in my third java program (yes, I'm new to this lang.) I have some
troubles:
-I often get StackOverFlow exceptions. What are the common problems that
lead to this error? I come from C/C++ programming, and perhaps have some
habits that are wrong used with Java...
-My program connects with two other instances of itself trought sockets.
Managing the connections requires the creation of 5 threads: one for the
connection (but I close the thread just after) and four for the 2 I/O
channels. I asked around and many people said this is the only available way
for non-blocking I/O (without using NIO). But my program is toooo slow now.
It requires 5 seconds for the connection (with all three program running on
the same machine) and several seconds even for reading -writing less than 10
bytes. Is a thread issue? Or am I making some stupid error?
troubles:
-I often get StackOverFlow exceptions. What are the common problems that
lead to this error? I come from C/C++ programming, and perhaps have some
habits that are wrong used with Java...
-My program connects with two other instances of itself trought sockets.
Managing the connections requires the creation of 5 threads: one for the
connection (but I close the thread just after) and four for the 2 I/O
channels. I asked around and many people said this is the only available way
for non-blocking I/O (without using NIO). But my program is toooo slow now.
It requires 5 seconds for the connection (with all three program running on
the same machine) and several seconds even for reading -writing less than 10
bytes. Is a thread issue? Or am I making some stupid error?