Giter VIP home page Giter VIP logo

androidserver's Introduction

Hi, I'm Tony Shen, a Developer 🚀 from China.

androidserver's People

Contributors

fengzhizi715 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

androidserver's Issues

请指教

不好意思不是很明白,请问您的库是指app本身作为服务端的意思吗?还是说提供了一组api去发送网络请求呢

websocket server 接收字符串长度限制

用的文件转base64来传递一些配置文件,最大大概10M出头...默认配置无法接收完全
最后再NettyWebSocketServerInitializer这个类里面找到了
pipeline.addLast("aggregator", HttpObjectAggregator(65536))
这个方法控制长度
但是实测修改成5和2010241024,获取到的数据长度都不会变化,也就是参数根本没生效

get请求加参数后匹配不到路由

fun startHTTPServer(context:Context, androidServer: AndroidServer) {
    androidServer
        .get("/ping") {request, response ->
            response.setBodyText("pong")
        }
        .start()
}
curl -v 127.0.0.1:8080/ping?id=1&name=test

response {"nameValuePairs":{"status":404,"reason":"404 Not Found"}}

Response issue

@fengzhizi715

When i start server from one device and any operation perform on server device at that time other connected device with server need to wait or you can say take time for get response

socket方式通信问题

使用socket方式通信,连接和断开的回调可以收到,收消息的回调收不到

大佬,请问websocket无法连接是怎么回事呢?

androidServer
.websocket("ws://${localIPAddress}:${port}/ws", object : SocketListener {
override fun onMessageResponseServer(msg: String, ChannelId: String) {
Log.e("WebSocketService", "msg = $msg")
}

            override fun onChannelConnect(channel: Channel) {
                val insocket = channel.remoteAddress() as InetSocketAddress
                val clientIP = insocket.address.hostAddress
                Log.e("WebSocketService", "connect client: $clientIP")

            }

            override fun onChannelDisConnect(channel: Channel) {
                val ip = channel.remoteAddress().toString()
                Log.e("WebSocketService", "disconnect client: $ip")
            }

        })
        .start()

我是这样写的,localIPAddress是用的你库里边的工具类,端口写的8080,然后AS查看日志,一直报disconnect client: /127.0.0.1:xxxx,
端口号一直在变化

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.