This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
The moose likes Servlets and the fly likes using sockets from within my servlet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

JavaRanch » Java Forums » Java » Servlets
Bookmark "using sockets from within my servlet" Watch "using sockets from within my servlet" New topic

using sockets from within my servlet

Neil Goldsmith
Ranch Hand

Joined: Nov 02, 2001
Posts: 34
I have a servlet that connects to a legacy server via a socket connection. it then reads/writes over this socket. It works fine in Tomcat, but I've ported the servlet over to Websphere and I can't seem to write to the socket. It connects just fine, but when I go to Write, the server never reads anything and I don't have any errors.

The code is pretty simple socket stuff. This part lives in my servlet:

This code lives in my Server which is just a POJO:

Like I said, I don't hit any exceptions. The servlet sends off his message in the write, but the server never gets anything to read in the buffer.

Is this a problem in Websphere? Do I need to configure anything?

William Brogden
Author and all-around good cowpoke

Joined: Mar 22, 2000
Posts: 13001
Is it possible that the output flush method must be called?
How does the sever end determine that it has gotten a complete transmission?
I agree. Here's the link:
subject: using sockets from within my servlet
It's not a secret anymore!