[合集][求助]如何与服务器通信

[复制链接]
查看11 | 回复0 | 2021-1-29 05:17:06 | 显示全部楼层 |阅读模式
───────────────────────────────────────
作者[email protected](risn),信区:Java
标题[求助]如何与服务器通信
时间天大求实BBS站(WedJun210:56:392004)
───────────────────────────────────────
转信站:PKU!news.happynet.org!TJUBBS
sendPacket=newDatagramPacket(data,s.length(),InetAddress.getByName(name),5000);请问各位高手这句中的name具体应该怎样写啊?
───────────────────────────────────────
作者[email protected](risn),信区:Java
标题Re:[求助]如何与服务器通信
时间天大求实BBS站(WedJun211:28:202004)
───────────────────────────────────────
转信站:PKU!news.happynet.org!TJUBBS
【在risn的大作中提到:】sendPacket=newDatagramPacket(data,s.length(),InetAddress.getByName(name),5000);请问各位高手这句中的name具体应该怎样写啊?
没人知道么??.......
───────────────────────────────────────
作者[email protected](sure),信区:Java
标题Re:[求助]如何与服务器通信
时间饮水思源(WedJun221:47:572004)
───────────────────────────────────────
转信站:PKU!news.happynet.org!netnews.sdu.edu.cn!SJTU
可以是ip可以是主机的名字,但是主机名字必须在局域网内部,广域网是ip也可以是[email protected] (risn) 在 ta 的帖子中提到:sendPacket=newDatagramPacket(data,s.length(),InetAddress.getByName(name),5000);请问各位高手这句中的name具体应该怎样写啊?
───────────────────────────────────────
作者[email protected](神经龙),信区:Java
标题Re:[求助]如何与服务器通信
时间天大求实BBS站(ThuJun310:10:162004)
───────────────────────────────────────
转信站:PKU!news.happynet.org!TJUBBS
IP||URL【在risn的大作中提到:】sendPacket=newDatagramPacket(data,s.length(),InetAddress.getByName(name),5000);请问各位高手这句中的name具体应该怎样写啊?
───────────────────────────────────────
作者[email protected](黄孙),信区:Java
标题Re:[求助]如何与服务器通信
时间白山黑水(ThuJun311:39:262004)
───────────────────────────────────────
转信站:PKU!news.happynet.org!news.neu.edu.cn!NEU
【在shenjinglong的大作中提到:】IP||URL【在risn的大作中提到:】:sendPacket=newDatagramPacket(data,s.length(),InetAddress.getByName(..:请问各位高手这句中的name具体应该怎样写啊?无奈啊郁闷那
───────────────────────────────────────
作者[email protected](是否被遗忘的ad),信区:Java
标题Re:[求助]如何与服务器通信
时间天大求实BBS站(FriJun412:31:342004)
───────────────────────────────────────
转信站:PKU!news.happynet.org!TJUBBS
其实你只要查查API手册就能明白了!!
getByNamepublicstaticInetAddressgetByName(Stringhost)throwsUnknownHostExceptionDeterminestheIPaddressofahost,giventhehost'sname.Thehostnamecaneitherbeamachinename,suchasjava.sun.com,oratextualrepresentationofitsIPaddress.IfaliteralIPaddressissupplied,onlythevalidityoftheaddressformatischecked.
ForhostspecifiedinliteralIPv6address,eithertheformdefinedinRFC2732ortheliteralIPv6addressformatdefinedinRFC2373isaccepted.
Parameters:host-thespecifiedhost,ornullforthelocalhost.Returns:anIPaddressforthegivenhostname.Throws:UnknownHostException-ifnoIPaddressforthehostcouldbefound.SecurityException-ifasecuritymanagerexistsanditscheckConnectmethoddoesn'tallowtheoperation
【在risn的大作中提到:】sendPacket=newDatagramPacket(data,s.length(),InetAddress.getByName(name),5000);请问各位高手这句中的name具体应该怎样写啊?
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行