含羞草 v2.1.6版本的 MD5 值为:6eb49dcd42f2b660ff6f51c70f543d8b
以下内容为反编译后的 PushClient.java 源代码,内容仅作参考
package com.video.live.goim;
import java.net.InetAddress;
import java.net.UnknownHostException;
import java.util.Date;
import java.util.Observable;
import java.util.Observer;
public class PushClient extends AbstractBlockingClient {
public PushClient(InetAddress inetAddress, int i, Integer num, String str) {
super(inetAddress, i, num, str);
}
@Override
protected void heartBeatReceived() {
System.out.println("heartBeatReceived ...");
}
@Override
protected void authSuccess() {
System.out.println("authSuccess ...");
}
@Override
protected void messageReceived(Long l, Long l2, Long l3, Long l4, Long l5, String str) {
StringBuilder sb = new StringBuilder();
sb.append("-----------------------------" + new Date().getTime() + "\n");
sb.append("headLength:" + l2 + "\n");
sb.append("version:" + l3 + "\n");
sb.append("operation:" + l4 + "\n");
sb.append("sequenceId:" + l5 + "\n");
sb.append("message:" + str + "\n");
sb.append("-----------------------------");
System.out.println(sb.toString());
}
@Override
protected void messageReceived(String str) {
StringBuilder sb = new StringBuilder();
sb.append(new Date().getTime() + "," + this.uid + ",message:" + str);
System.out.println(sb.toString());
}
@Override
protected void connected(boolean z) {
System.out.println("alreadyConnected is " + z);
}
@Override
protected void disconnected() {
System.out.println("disconnected....... ");
}
class Listener implements Observer {
Listener() {
}
@Override
public void update(Observable observable, Object obj) {
System.out.println("PushClient 死机");
PushClient pushClient = new PushClient(PushClient.this.getServer(), PushClient.this.getPort(), PushClient.this.uid, PushClient.this.game);
pushClient.addObserver(this);
new Thread(pushClient).start();
System.out.println("PushClient 重启");
}
}
public static void main(String[] strArr) throws UnknownHostException {
PushClient pushClient = new PushClient(InetAddress.getByName("10.160.61.129"), 8080, 1, "game");
pushClient.addObserver(new Listener());
new Thread(pushClient).start();
}
}