java socket programming

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Rohan Thakare

    java socket programming

    i am having a file containg data for students name and their marks. i am sending this file from client to server using
    Code:
    Socket clientSocket = new Socket("127.0.0.1", portNo);
    OutputStream os = clientSocket.getOutputStream();           
    os.write(clientWriteArr,0,clientWriteArr.length);
    and on server side reading the file contents using
    Code:
    ServerSocket sock = new ServerSocket(5432);
    Socket serverSocket = sock.accept();
    InputStream is = serverSocket.getInputStream();
    i am modifyidng the file contents on server side
    all the above thing are working fine.
    now i want to send this file back to client using the same socket connection. but this thing is not working and i am not getting any exception.
  • JavierL
    New Member
    • Apr 2010
    • 17

    #2
    You need to open another connection, because you are sending in one way, one socket is waiting for input (and receiving), the other is sending.

    Comment

    Working...