public abstract class SocketHandler extends Object
限定符和类型 | 字段和说明 |
---|---|
protected static int |
CONNECTED_MESSAGE |
protected static int |
DISCONNECTED_MESSAGE |
protected static int |
FAIL_MESSAGE |
protected boolean |
isInterrupted |
protected Object |
readLocker |
protected static int |
START_MESSAGE |
protected Object |
writeLocker |
构造器和说明 |
---|
SocketHandler() |
限定符和类型 | 方法和说明 |
---|---|
protected abstract Object |
getSend() |
protected void |
handleConnectedMessage() |
protected void |
handleDisconnectedMessage() |
protected void |
handleFailMessage(Object obj,
Exception exception) |
protected void |
handleMessage(Message msg) |
abstract boolean |
handleSocketRead(DataInputStream inputStream) |
abstract boolean |
handleSocketWrite(DataOutputStream outputStream) |
protected void |
handleStartMessage() |
void |
interrupted() |
boolean |
isInterrupted() |
protected Message |
obtainMessage(int responseMessage,
int arg1,
int arg2,
Object response) |
protected Message |
obtainMessage(int responseMessage,
Object response) |
protected void |
onConnected() |
protected void |
onDisconnected() |
protected abstract void |
onFail(Object obj,
Exception e) |
protected void |
onStart() |
void |
sendConnectedMessage() |
void |
sendDisconnectedMessage() |
void |
sendFailMessage(Object obj) |
protected void |
sendMessage(Message msg) |
void |
sendStartMessage() |
protected static final int FAIL_MESSAGE
protected static final int START_MESSAGE
protected static final int CONNECTED_MESSAGE
protected static final int DISCONNECTED_MESSAGE
protected Object readLocker
protected Object writeLocker
protected boolean isInterrupted
protected void sendMessage(Message msg)
protected Message obtainMessage(int responseMessage, Object response)
protected Message obtainMessage(int responseMessage, int arg1, int arg2, Object response)
protected void handleMessage(Message msg)
public abstract boolean handleSocketWrite(DataOutputStream outputStream) throws IOException
IOException
public abstract boolean handleSocketRead(DataInputStream inputStream) throws IOException, ClassNotFoundException
protected abstract Object getSend()
protected void onStart()
protected void onConnected()
protected void onDisconnected()
public void sendFailMessage(Object obj)
public void sendStartMessage()
public void sendConnectedMessage()
public void sendDisconnectedMessage()
protected void handleStartMessage()
protected void handleConnectedMessage()
protected void handleDisconnectedMessage()
public boolean isInterrupted()
public void interrupted()