Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

servlets and socket connection

Status
Not open for further replies.

monrosal

Programmer
Aug 22, 2000
42
0
0
US
I created a servlet which communicates to a server via sockets. The servlet sends data to the server. The server then does some processing on the data and shoots it back to the servlet. My problem is the servlet chokes up when it receives the data back from the server. Can anybody help me with this?

Ramon
 
Hi Ramon

Try running the send and response activity in different threads. If you try to do everything in a single thread, one stream might block the processing of the other. There is some example socket processing code from Java Examples in a Nutshell, 2nd Edition at that might help.

scrat
 
I had a similar problem with a servlet sending and receiving data via sockets. I solved it by using two sockets - one for sending and one for receiving.
 
Yeah, these sort of problems are known issues with Java IO. The NIO in J2SE 1.4 is supposed to fully address these issues.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top