:请教怎么解决JAVA socket通信时的缓冲区的清空有关问题

紧急求助:请问如何解决JAVA socket通信时的缓冲区的清空问题
我用servlet作的socket连接客户端的访问程序;需要用web页面通过socket收发远程客户端的数据信息;每次连接客户端是通过数据库查询ip及port后,用相应的ip及port进行连接;为什么连上以后向客户端发送信息后再读取客户端返回过来的信息都是一样的?servlet不是多线程的吗?每连接一个socket应该都是新的线程;为什么输入缓冲区里的数据还是一直是同一个客户端的数据;连接新的连接后读取缓冲区的数据还是旧的?缓冲区是共享的吗?请问能不能为每个连接建立独立的缓冲区?谢谢!

下面是我的一部分代码请大家指教:

servlet的
  public   void   doGet(HttpServletRequest   request,   HttpServletResponse   response)   throws
                        ServletException,   IOException   {
                response.setContentType(CONTENT_TYPE);
                PrintWriter   out   =   response.getWriter();
                sta=(StationVO)   request.getAttribute( "setst ");\\得到数据库查询数据
                out.println( " <input   type=hidden   name=id   value=\ " "+sta.getId()+ "\ "/> ");
                out.println( " <input   type=hidden   name=type   value=\ " "+request.getParameter( "type ")+ "\ "/> ");
                String   host=sta.getSIp();\\从bean得到查询的ip
                int   port=sta.getSPort();\\从bean得到查询的port
                if(socketbean.cSocket==null){
                          socketbean.connectionsocket(host,port);\\通过socketbean连接
                  }
                else   if(socketbean.cSocket!=null){
                          try   {
                                  socketbean.searchtw();
                                  if   (socketbean.getDataInputStream()   !=   null)   {
                                          socketbean.read();\\每次读的还是以前的数据,如何解决?
                                  }
                          }   catch   (Exception   e)   {

                    }            

socketbean的代码:

import   java.net.*;
import   java.io.*;
import   java.util.*;
import   java.lang.*;

public   class   SocketBean   {

        public   SocketBean()   {
        }
        private   String   Address;   //服务器地址
        private   int   Port;   //服务器端口
        public   Socket   cSocket   =   null;   //Socket
        public   byte[]   a   =   new   byte[16];
        private   DataOutputStream   dos   =   null;