西安邮电大学《分布式计算原理及应用》实验报(4)

发布时间:2021-06-05

Socket socket = null;

InputStream input = null;

OutputStream output = null;

try {

socket = serverSocket.accept();

input = socket.getInputStream();

output = socket.getOutputStream();

// create Request object and parse

Request request = new Request(input);

request.parse();

// create Response object

Response response = new Response(output);

response.setRequest(request);

response.sendStaticResource();

// Close the socket

socket.close();

//check if the previous URI is a shutdown command

shutdown = request.getUri().equals(SHUTDOWN_COMMAND);

}

catch (Exception e) {

精彩图片

热门精选

大家正在看