public class NetService extends java.lang.Thread implements NetServiceable, java.lang.AutoCloseable
Modifier and Type | Class and Description |
---|---|
static class |
NetService.Builder
builder.
|
static class |
NetService.NetRequest
NetRequest.
|
Modifier and Type | Method and Description |
---|---|
void |
close()
close.
|
int |
getIndex()
Returns index.
|
boolean |
getSendCompilete()
Returns true will encryption.
|
void |
onClose()
Close connection event.
|
void |
run() |
void |
send(java.lang.String message)
Send message.
|
void |
sendClose(java.lang.String message)
Close connection after sending message.
|
void |
setCommandProcessorProvider(CommandProcessorProvider<NetService.NetRequest> provider)
Set command processor.
|
void |
setSendCompilete(boolean compilete)
Enable encryption.
|
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
public void run()
run
in interface java.lang.Runnable
run
in class java.lang.Thread
public void setCommandProcessorProvider(CommandProcessorProvider<NetService.NetRequest> provider)
provider
- CommandProcessorProviderpublic int getIndex()
public void onClose()
Serviceable
onClose
in interface Serviceable<java.lang.String>
public void close()
close
in interface java.lang.AutoCloseable
public void send(java.lang.String message)
public void sendClose(java.lang.String message)
public boolean getSendCompilete()
NetServiceable
getSendCompilete
in interface NetServiceable
public void setSendCompilete(boolean compilete)
NetServiceable
setSendCompilete
in interface NetServiceable
compilete
- enable encryption