blob: 86713d207b633b7a73a219f0c9458cf2837028d1 (
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
|
// **********************************************************************
//
// Copyright (c) 2003-2004 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 <Ice/TransportInfoI.h>
#include <Ice/ConnectionI.h>
#include <Ice/ReferenceFactory.h>
#include <Ice/ProxyFactory.h>
#include <Ice/Instance.h>
using namespace std;
using namespace Ice;
using namespace IceInternal;
void
Ice::TransportInfoI::flushBatchRequests()
{
ConnectionIPtr connection;
{
IceUtil::Mutex::Lock sync(_connectionMutex);
connection = _connection;
}
//
// We flush outside the mutex lock, to avoid potential deadlocks.
//
if(connection)
{
connection->flushBatchRequest();
}
}
ObjectPrx
Ice::TransportInfoI::createProxy(const Identity& ident) const
{
IceUtil::Mutex::Lock sync(_connectionMutex);
//
// Create a reference and return a reverse proxy for this
// reference.
//
vector<EndpointPtr> endpoints;
vector<ConnectionIPtr> connections;
connections.push_back(_connection);
ReferencePtr ref = _connection->instance()->referenceFactory()->create(ident, Context(), "", Reference::ModeTwoway,
false, "", endpoints, 0, 0,
connections, true);
return _connection->instance()->proxyFactory()->referenceToProxy(ref);
}
void
Ice::TransportInfoI::setConnection(const ConnectionIPtr& connection)
{
IceUtil::Mutex::Lock sync(_connectionMutex);
_connection = connection;
}
|