Skip to content

Instantly share code, notes, and snippets.

@binjoo
Created October 21, 2012 09:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save binjoo/3926471 to your computer and use it in GitHub Desktop.
Save binjoo/3926471 to your computer and use it in GitHub Desktop.
JAVA:模拟飞秋发送消息
public class FeiQSocket {
public static void main(String[] args) throws Exception {
List<String> hosts = new ArrayList<String>();
String host = "localhost"; //目标IP
int port = 2425; //目标端口,缺省为 2425
InetAddress IPAddress = InetAddress.getByName(host);
//String str = "1_lbt4_10#32899#002481627512#0#35807#0:1:Administrators:1D46A2A23307456:288:内容"; //普通消息
String str = "1_lbt4_35#128#0022680C51AC#0#35807#0:1250815230:Administrators:1D46A2A23307456:209:"; //抖屏
byte[] buf = str.getBytes();
DatagramPacket sendPacket = new DatagramPacket(buf, buf.length, IPAddress, port);
DatagramSocket sendSocket = new DatagramSocket();
sendSocket.send(sendPacket); // 发送数据包
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment