Mina实战五:Client启动时如果没有Server,就先建立Server

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/haoranhaoshi/article/details/89108625

Mina框架介绍:https://blog.csdn.net/haoranhaoshi/article/details/89102597
Mina实战一:建立Server和Client。有Client加入,Server广播给所有Client:https://blog.csdn.net/haoranhaoshi/article/details/89103348
Mina实战二:在控制台中Client可以给Sever和其他Client发送数据:https://blog.csdn.net/haoranhaoshi/article/details/89103887
Mina实战三:特定角色的Client处理消息:https://blog.csdn.net/haoranhaoshi/article/details/89103993
Mina实战四:特定角色收到消息:https://blog.csdn.net/haoranhaoshi/article/details/89108502
Mina实战五:Client启动时如果没有Server,就先建立Server:https://blog.csdn.net/haoranhaoshi/article/details/89108625
Mina实战六:不独立启动Server,Client通信:https://blog.csdn.net/haoranhaoshi/article/details/89109412
Mina实战工程下载:https://download.csdn.net/download/haoranhaoshi/11100668

            // 在Mina实战四基础上修改MinaClient的session = future.getSession();即可
            try{
                session = future.getSession();
            } catch(RuntimeIoException runtimeIoException){
                MinaServer minaServer = new MinaServer();
                if(minaServer.start()){
                    return connect();
                }
            }

猜你喜欢

转载自blog.csdn.net/haoranhaoshi/article/details/89108625