本文整理汇总了Java中de.tavendo.autobahn.WebSocketConnection类的典型用法代码示例。如果您正苦于以下问题:Java WebSocketConnection类的具体用法?Java WebSocketConnection怎么用?Java WebSocketConnection使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
WebSocketConnection类属于de.tavendo.autobahn包,在下文中一共展示了WebSocketConnection类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: Server
import de.tavendo.autobahn.WebSocketConnection; //导入依赖的package包/类
public Server(WebSocketConnection wsc, Activity act) {
this.wsc = wsc;
this.act = act;
uiInit();
String firstMessage = "Hello~ 点击talk键开始匹配聊天,点击stop结束聊天";
TalkMessage talkMessage = new TalkMessage(3, firstMessage);
chatList = new ArrayList<TalkMessage>();
chatList.add(talkMessage);
chatAdapter = new TalkAdapter(act.getApplicationContext(), chatList);
chatView.setAdapter(chatAdapter);
try {
startServer();
sendListener();
switchListener();
} catch (WebSocketException e) {
e.printStackTrace();
}
}
示例2: RcatExtendedPuzzleSurface
import de.tavendo.autobahn.WebSocketConnection; //导入依赖的package包/类
public RcatExtendedPuzzleSurface(Context context, WebSocketConnection conn) {
super(context);
//MAX_PUZZLE_PIECE_SIZE = 80;
msgContext = context;
mConn = conn;
lockedPaint = new Paint();
lockedPaint.setColor(Color.RED);
lockedPaint.setStyle(Paint.Style.STROKE);
lockedPaint.setStrokeWidth(5);
controlledPaint = new Paint();
controlledPaint.setColor(Color.BLUE);
controlledPaint.setStyle(Paint.Style.STROKE);
controlledPaint.setStrokeWidth(5);
setLongClickable(true);
setOnLongClickListener(new View.OnLongClickListener() {
public boolean onLongClick(View v) {
lockedPaint.setColor(Color.GREEN);
controlledPaint.setColor(Color.GREEN);
return true;
}
});
}
示例3: onCreate
import de.tavendo.autobahn.WebSocketConnection; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
wsc = new WebSocketConnection();
server = new Server(wsc, this);
}
示例4: TopicManager
import de.tavendo.autobahn.WebSocketConnection; //导入依赖的package包/类
public TopicManager(String topic, String url, WebSocketConnection mConnection){
this.topic = topic;
this.url = url;
this.mConnection = mConnection;
this.text = "NO DATA?";
fieldMap = new HashMap<String, String>();
}
示例5: ROSMonitorManager
import de.tavendo.autobahn.WebSocketConnection; //导入依赖的package包/类
/**
* Constructor
* @param master : The background service that will control live card creation
* @param conn WebSocketConnection : connection to send and receive messages
*/
public ROSMonitorManager(ROSMonitorService master, WebSocketConnection conn){
_lastWarning = "";
message_times = new HashMap<String, Long>();
_master = master;
mConnection = conn;
}
示例6: connect
import de.tavendo.autobahn.WebSocketConnection; //导入依赖的package包/类
public static void connect(WebSocketConnection wsc) {
wsc.sendTextMessage("{\"status\": 0}");
}
示例7: disconnect
import de.tavendo.autobahn.WebSocketConnection; //导入依赖的package包/类
public static void disconnect(WebSocketConnection wsc) {
wsc.sendTextMessage("{\"status\": -1}");
}
示例8: sendWordMessage
import de.tavendo.autobahn.WebSocketConnection; //导入依赖的package包/类
public static void sendWordMessage(WebSocketConnection wsc, String content) {
wsc.sendTextMessage("{\"status\": 1, \"content\":\"" + content + "\"}");
}
示例9: getConnection
import de.tavendo.autobahn.WebSocketConnection; //导入依赖的package包/类
public WebSocketConnection getConnection() {
return connectionService.getConnection();
}
示例10: getConnection
import de.tavendo.autobahn.WebSocketConnection; //导入依赖的package包/类
public WebSocketConnection getConnection() {
return connection;
}
示例11: onCreate
import de.tavendo.autobahn.WebSocketConnection; //导入依赖的package包/类
@Override
public void onCreate() {
Ln.i(getClass().getSimpleName() + " in onCreate()");
connection = new WebSocketConnection();
}