📄 udpsend.java
字号:
import java.net.*;
public class UdpSend {
/**
* Method main
*
*
* @param args
*
*/
public static void main(String[] args) throws Exception
{
// TODO: Add your code here
DatagramSocket ds = new DatagramSocket();
String strInfo = "hello你好";
ds.send(new DatagramPacket("hello你好".getBytes(),"hello你好".getBytes().length,InetAddress.getByName("192.168.1.238"),3000));
ds.close();
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -