第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時綁定郵箱和手機(jī)立即綁定

為什么會報錯 如何解決?

package data;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.net.Socket;

public class serverThread implements Runnable {
private Socket ss;
private String KehuDuanXinxi=null;
/*private int xianchengxulie;
private String KehuDuanName;
*/
public serverThread(Socket ss) {
this.ss = ss;
}

public void run() {
/*String string="客戶端你好";
socketoOutput(string);*/

KehuDuanXinxi = socketoInput();
socketoOutput("sdfe");
System.out.println("接收到服務(wù)器信息內(nèi)容是" + KehuDuanXinxi);


//serverThread ser= new serverThread(ss);

}

private InputStream is=null;
private InputStreamReader isr=null;
private BufferedReader br=null;

public String socketoInput() ?{
String string=null;
try {
is = ss.getInputStream();
isr = new InputStreamReader(is);
? ?br = new BufferedReader(isr);
? ? ? ?string = br.readLine();
? ? ? ?ss.shutdownInput();
? ? ? ?
? ? ? ?
? ? ? ?
os = ss.getOutputStream();
pw= new PrintWriter(os);
pw.write("服務(wù)器說 歡迎你");
pw.flush();
ss.shutdownOutput();
} catch (IOException e) {
// TODO 自動生成的 catch 塊
e.printStackTrace();
}finally {

try {
if (br!=null)
br.close();
if (isr!=null)
isr.close();
if (is!=null)
is.close();
if (pw!=null)
pw.close();
if(os!=null)
os.close();
} catch (IOException e) {
// TODO 自動生成的 catch 塊
e.printStackTrace();
}

}


//while((string=br.readLine())!=null){ xmlOutput(string); }


return string;
}

private OutputStream os=null;
private PrintWriter pw=null;

public void socketoOutput(String string) {

try {
os = ss.getOutputStream();
pw = new PrintWriter(os);
pw.write(string);
pw.flush();
ss.shutdownOutput();

} catch (IOException e) {
// TODO 自動生成的 catch 塊
e.printStackTrace();
} finally {


try {
if (pw!=null)
pw.close();
if(os!=null)
os.close();
} catch (IOException e) {
// TODO 自動生成的 catch 塊
e.printStackTrace();
}

}

}

public void xmlInput() {

}

public void xmlOutput(String string) {

}
}

這段代碼 會提示Socket is closed報錯

正在回答

舉報

0/150
提交
取消

為什么會報錯 如何解決?

我要回答 關(guān)注問題
微信客服

購課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學(xué)習(xí)伙伴

公眾號

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號