summaryrefslogtreecommitdiff
path: root/cpp/src/IceWS/AcceptorI.cpp
blob: c3f536c733b8bbe4895f8f1a7233f4192d983cbb (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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
// **********************************************************************
//
// Copyright (c) 2003-2014 ZeroC, Inc. All rights reserved.
//
// This copy of Ice is licensed to you under the terms described in the
// ICE_LICENSE file included in this distribution.
//
// **********************************************************************

#include <IceWS/AcceptorI.h>
#include <IceWS/Instance.h>
#include <IceWS/TransceiverI.h>

using namespace std;
using namespace Ice;
using namespace IceWS;

IceInternal::NativeInfoPtr
IceWS::AcceptorI::getNativeInfo()
{
    return _delegate->getNativeInfo();
}

#ifdef ICE_USE_IOCP
IceInternal::AsyncInfo*
IceWS::AcceptorI::getAsyncInfo(IceInternal::SocketOperation status)
{
    return _delegate->getNativeInfo()->getAsyncInfo(status);
}
#endif

void
IceWS::AcceptorI::close()
{
    _delegate->close();
}

void
IceWS::AcceptorI::listen()
{
    _delegate->listen();
}

#ifdef ICE_USE_IOCP
void
IceWS::AcceptorI::startAccept()
{
    _delegate->startAccept();
}

void
IceWS::AcceptorI::finishAccept()
{
    _delegate->finishAccept();
}
#endif

IceInternal::TransceiverPtr
IceWS::AcceptorI::accept()
{
    //
    // WebSocket handshaking is performed in TransceiverI::initialize, since
    // accept must not block.
    //
    return new TransceiverI(_instance, _delegate->accept());
}

string
IceWS::AcceptorI::protocol() const
{
    return _delegate->protocol();
}

string
IceWS::AcceptorI::toString() const
{
    return _delegate->toString();
}

IceWS::AcceptorI::AcceptorI(const InstancePtr& instance, const IceInternal::AcceptorPtr& del) :
    _instance(instance), _delegate(del)
{
}

IceWS::AcceptorI::~AcceptorI()
{
}