发送/通过TCP套接字接收字节[] [英] Send/Receive byte[] via TCP Socket

查看:248
本文介绍了发送/通过TCP套接字接收字节[]的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


  1. 我想(.db的*)在通过TCP套接字连接的byte []发送/接收SQLite数据库文件?

  2. 有没有用Java / Android的为Socket.Poll()C#?
  3. 类似的方法

我是新用Java / Android的

I'm new in Java / Android

推荐答案

使用插座类。

有没有民意测验方法,但也有一些可以用来查看端口状态的其他方法。
例如,你可以使用 Socket.isOutputShutdown()来检查,如果输出流是可用的(无论是已经关机或没有),你可以使用 Socket.getInputStream()。用()来获取可用的字节数读取的现在

There is no Poll method, however there are other methods that can be used to check the socket status. For example, you can use Socket.isOutputShutdown() to check if the output stream is available (Whether it has been shutdown or not), and you can use Socket.getInputStream().available() to get the number of bytes available to read now.

这篇关于发送/通过TCP套接字接收字节[]的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆