SuperVCD管理系统 java版完整代码 带各种注释....(18)
发布时间:2021-06-07
发布时间:2021-06-07
SuperVCD管理系统 完整代码,带各种注释,可以拿这个项目入门。
import java.io.*;
import .*;
import java.util.*;
/**
* 这个类是socket连接的处理器
* 例如:
* <pre>
* Handler aHandler = new Handler(clientSocket, myMusicDataAccessor);
* aHandler.start();
* </pre>
*
*
*/
public class Handler extends Thread implements StoneForestProtocol {
protected Socket clientSocket;
protected ObjectOutputStream outputToClient;
protected ObjectInputStream inputFromClient;
protected MusicDataAccessor myMusicDataAccessor;
protected boolean done;
public Handler(Socket theClientSocket, MusicDataAccessor theMusicDataAccessor) throws IOException {
clientSocket = theClientSocket;
outputToClient = new ObjectOutputStream(clientSocket.getOutputStream()); inputFromClient = new ObjectInputStream(clientSocket.getInputStream());
myMusicDataAccessor = theMusicDataAccessor;
done = false;
}
public void run() {
try {
while (!done) {
log("等待命令...");
int opCode = inputFromClient.readInt();
log("opCode = " + opCode);
上一篇:六年级尖子生测试卷
下一篇:学生学习水平测试分析