当前位置: 首页>>代码示例>>Java>>正文


Java WebSocketConnection类代码示例

本文整理汇总了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();
    }
}
 
开发者ID:Hi-Rube,项目名称:RChat-Server,代码行数:19,代码来源:Server.java

示例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;
        }
    });
}
 
开发者ID:Mondego,项目名称:rcat-android-client,代码行数:26,代码来源:RcatExtendedPuzzleSurface.java

示例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);
}
 
开发者ID:Hi-Rube,项目名称:RChat-Server,代码行数:8,代码来源:MainActivity.java

示例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>();
}
 
开发者ID:unl-nimbus-lab,项目名称:ros_glass_tools,代码行数:8,代码来源:TopicManager.java

示例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;
}
 
开发者ID:unl-nimbus-lab,项目名称:ros_glass_tools,代码行数:12,代码来源:ROSMonitorManager.java

示例6: connect

import de.tavendo.autobahn.WebSocketConnection; //导入依赖的package包/类
public static void connect(WebSocketConnection wsc) {
    wsc.sendTextMessage("{\"status\": 0}");
}
 
开发者ID:Hi-Rube,项目名称:RChat-Server,代码行数:4,代码来源:SendController.java

示例7: disconnect

import de.tavendo.autobahn.WebSocketConnection; //导入依赖的package包/类
public static void disconnect(WebSocketConnection wsc) {
    wsc.sendTextMessage("{\"status\": -1}");
}
 
开发者ID:Hi-Rube,项目名称:RChat-Server,代码行数:4,代码来源:SendController.java

示例8: sendWordMessage

import de.tavendo.autobahn.WebSocketConnection; //导入依赖的package包/类
public static void sendWordMessage(WebSocketConnection wsc, String content) {
    wsc.sendTextMessage("{\"status\": 1, \"content\":\"" + content + "\"}");
}
 
开发者ID:Hi-Rube,项目名称:RChat-Server,代码行数:4,代码来源:SendController.java

示例9: getConnection

import de.tavendo.autobahn.WebSocketConnection; //导入依赖的package包/类
public WebSocketConnection getConnection() {
    return connectionService.getConnection();
}
 
开发者ID:AndFChat,项目名称:AndFChat,代码行数:4,代码来源:AndFChatApplication.java

示例10: getConnection

import de.tavendo.autobahn.WebSocketConnection; //导入依赖的package包/类
public WebSocketConnection getConnection() {
    return connection;
}
 
开发者ID:AndFChat,项目名称:AndFChat,代码行数:4,代码来源:AndFChatConnectionService.java

示例11: onCreate

import de.tavendo.autobahn.WebSocketConnection; //导入依赖的package包/类
@Override
public void onCreate() {
    Ln.i(getClass().getSimpleName() + " in onCreate()");
    connection = new WebSocketConnection();
}
 
开发者ID:AndFChat,项目名称:AndFChat,代码行数:6,代码来源:AndFChatConnectionService.java


注:本文中的de.tavendo.autobahn.WebSocketConnection类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。