summaryrefslogtreecommitdiff
path: root/js/src/Ice/TcpEndpointFactory.js
blob: 5ba0f82dd7d31497d96c55a8dd8060b03433bcc9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
//
// Copyright (c) ZeroC, Inc. All rights reserved.
//

const Ice = require("../Ice/TcpEndpointI").Ice;
const TcpEndpointI = Ice.TcpEndpointI;

class TcpEndpointFactory
{
    constructor(instance)
    {
        this._instance = instance;
    }

    type()
    {
        return this._instance.type();
    }

    protocol()
    {
        return this._instance.protocol();
    }

    create(args, oaEndpoint)
    {
        const e = new TcpEndpointI(this._instance);
        e.initWithOptions(args, oaEndpoint);
        return e;
    }

    read(s)
    {
        const e = new TcpEndpointI(this._instance);
        e.initWithStream(s);
        return e;
    }

    destroy()
    {
        this._instance = null;
    }

    clone(instance)
    {
        return new TcpEndpointFactory(instance);
    }
}

Ice.TcpEndpointFactory = TcpEndpointFactory;
module.exports.Ice = Ice;