com.aiyc.server.standalone.longwait
类 AloneServer

java.lang.Object
  继承者 com.aiyc.server.standalone.longwait.AloneServer
所有已实现的接口:
Server, Runnable

public class AloneServer
extends Object
implements Server, Runnable

服务入口程序

作者:
felly

嵌套类摘要
 class AloneServer.ShutdownHandler
           
 
方法摘要
 void addCallBack(String msg)
           
 void addNotify(Notifyer er)
          添加推送服务
 void addSokect(Client socket)
           
 void destory()
           
 List<Client> getClients()
           
 int getPort()
           
 Client getSokect(int id)
           
 Client getSokect(String userNo)
           
 Client getSokect(String ip, int port)
           
static AloneServer instance()
           
 boolean isStart()
           
static void main(String[] args)
          入口程序
 List<String> qetCallBackMsg()
           
 void removeSokect(Client socket)
           
 void removeSokect(int id)
           
 void removeSokect(String ip, int port)
           
 void run()
           
 void sendAll(byte[] b)
          发送给全部客户端
 void sendMsg(Socket socket, byte[] b)
          给指定socket发送消息
 void start()
           
 void startNotify()
           
 
从类 java.lang.Object 继承的方法
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

方法详细信息

addNotify

public void addNotify(Notifyer er)
添加推送服务

指定者:
接口 Server 中的 addNotify

startNotify

public void startNotify()
                 throws NotifyException
指定者:
接口 Server 中的 startNotify
抛出:
NotifyException

run

public void run()
指定者:
接口 Runnable 中的 run

getSokect

public Client getSokect(int id)
指定者:
接口 Server 中的 getSokect

getSokect

public Client getSokect(String ip,
                        int port)
指定者:
接口 Server 中的 getSokect

removeSokect

public void removeSokect(int id)
指定者:
接口 Server 中的 removeSokect

removeSokect

public void removeSokect(String ip,
                         int port)
指定者:
接口 Server 中的 removeSokect

getClients

public List<Client> getClients()
指定者:
接口 Server 中的 getClients

destory

public void destory()
指定者:
接口 Server 中的 destory

main

public static void main(String[] args)
                 throws Exception
入口程序

参数:
args -
抛出:
Exception

getPort

public int getPort()
指定者:
接口 Server 中的 getPort

instance

public static AloneServer instance()

start

public void start()
指定者:
接口 Server 中的 start

addSokect

public void addSokect(Client socket)
指定者:
接口 Server 中的 addSokect

removeSokect

public void removeSokect(Client socket)
指定者:
接口 Server 中的 removeSokect

isStart

public boolean isStart()
指定者:
接口 Server 中的 isStart

qetCallBackMsg

public List<String> qetCallBackMsg()

addCallBack

public void addCallBack(String msg)

sendMsg

public void sendMsg(Socket socket,
                    byte[] b)
给指定socket发送消息

指定者:
接口 Server 中的 sendMsg

sendAll

public void sendAll(byte[] b)
发送给全部客户端

指定者:
接口 Server 中的 sendAll
参数:
b -

getSokect

public Client getSokect(String userNo)
指定者:
接口 Server 中的 getSokect


Copyright © 2017. All Rights Reserved.