/**
 * Created by zzsun on 15-2-5.
 */
var _socket;
module.exports = function (context, ID, callback) {
    if (_socket) {
        _socket._context = context;
        _socket._onReceive = callback;
        return _socket;
    }
    (function (context, ID, _callback) {
        var TAWebSocket = require('./tawebsocket');
        _socket = new TAWebSocket();
        _socket._context = context;
        _socket._onReceive = _callback;
        _socket.init(ID);
    })(context, ID, callback);
    return _socket;
};