如何使用Java连接到wifi设备?

问题描述:

我想知道如何在 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