通过WLAN的Java套接字? [英] Java Sockets over WLAN?

查看:132
本文介绍了通过WLAN的Java套接字?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有2台Windows PC通过ad hoc无线网络连接.
使用这个现有的连接,我可以通过套接字在这些PC之间进行通信吗?
我可以在其中一台计算机上打开服务器插槽,然后将另一台计算机作为客户端并连接到另一台计算机,然后通过此连接发送和接收数据吗?
我是否需要特定的api还是可以只使用java.net.Socketjava.net.ServerSocket?

I have 2 windows PC's connected over an ad-hoc wlan network.
Using this existing connection can I communicate between these pc's via sockets?
Can I open a server socket on one pc and make the other pc a client and connect to the other pc and then send and receive data over this connection?
Do I need a specific api for this or can I just use java.net.Socket and java.net.ServerSocket?

推荐答案

当然可以. WLAN连接上有一个IP网络,没有什么阻止您建立TCP连接.

Of course you can. There is an IP network over the WLAN connection, and nothing stops you from establinshing TCP connection.

就套接字而言,这与有线(以太网)连接没有什么不同,不同之处在于数据链接层

As far as sockets are concerned this is no different to a wired (Ethernet) connection, the difference ends at Data-Link layer

这篇关于通过WLAN的Java套接字?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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