如何使用Java连接到wifi设备? [英] How to connect to wifi devices using Java?
问题描述
我想知道如何在 wifi 范围内的设备之间用 Java 建立连接.
I want to know how to establish connection in Java between devices within wifi range.
谢谢,提前.
推荐答案
要通过网络(WiFi、电缆等)在两个设备之间建立连接,您需要编写 2 个软件:
To establish a connection between two devices over a network (WiFi, cable, etc...) you need to write 2 pieces of software:
1) 服务器:等待连接
1) A server: which waits for connections
2) 客户端:发起与服务器的连接
2) A client: which initiates a connection to the server
一旦客户端发起 TCP 连接,设备就会连接起来,您可以在它们之间发送数据和消息.
Once the client initiates a TCP connection then the devices are connected and you can send data and messages between them.
此处:Java 套接字
以下是有关如何编写聊天应用程序的完整分步教程:客户端/服务器对
Here's a COMPLETE step by step tutorial on how to write a chat application: Client/Server Pair
这篇关于如何使用Java连接到wifi设备?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!