"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.wrapServerSocket = wrapServerSocket;
const _1 = require("../Class/$");
function wrapServerSocket(_socket, system) {
    const socket = new (class Channel extends _1.$ {
        constructor(system) {
            super(system);
            this.__ = ['CH'];
            _socket.onmessage = (data) => {
                this.emit('message', data);
            };
            _socket.onclose = (code, message) => {
                this.emit('close', { code, message });
            };
        }
        send(data) {
            _socket.send(data);
            return;
        }
    })(system);
    return socket;
}
//# sourceMappingURL=ServerSocket.js.map