Java Socket Read getResponse(Socket socket)

Here you can find the source of getResponse(Socket socket)

Description

get Response

License

Open Source License

Declaration

public static String getResponse(Socket socket) throws IOException 

Method Source Code


//package com.java2s;
//License from project: Open Source License 

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

import java.net.Socket;

public class Main {
    public static String getResponse(Socket socket) throws IOException {
        BufferedReader in = new BufferedReader(new InputStreamReader(socket.getInputStream()));
        String response = in.readLine();
        return response;
    }//from   www .j a v a2  s.  c  o  m
}

Related

  1. getBufferedReaderFromInputStream(Socket socket)
  2. getInputStream(Socket socket)
  3. getInputStreamFromSocket(final Socket socket)
  4. getPrintWriter(Socket s)
  5. getPrintWriterFromOutputStream(Socket socket)
  6. readBytesIntoSocket(Socket socket)
  7. readData(Socket connId, byte[] dataRead, int nchar)
  8. readMsg(Socket s)