📄 mconnectorobserver.java
字号:
package net.jumperz.app.MTCPC_cui;
import net.jumperz.net.*;
import net.jumperz.util.*;
public class MConnectorObserver
implements MObserver1
{
private MConnector Connector;
private MTCPC_cui TCPC_cui;
//-----------------------------------------------------------------------------
public MConnectorObserver( MConnector IN_Connector, MTCPC_cui IN_TCPC_cui )
{
Connector = IN_Connector;
TCPC_cui = IN_TCPC_cui;
}
//-----------------------------------------------------------------------------
public void update()
{
int state = Connector.getState();
if( state == MConnector.CONNECTED )
{
TCPC_cui.startSession( Connector.getSocket() );
}
else if( state == MConnector.ERROR )
{
int error_code = Connector.getErrorCode();
if( error_code == MConnector.UNKNOWNHOST )
{
System.out.println( "Unknown Host." );
}
else if( error_code == MConnector.IOERROR )
{
System.out.println( "Connect Error." );
}
TCPC_cui.exit();
}
}
//-----------------------------------------------------------------------------
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -