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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
|
// **********************************************************************
//
// Copyright (c) 2003-2006 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.
//
// **********************************************************************
#ifndef ICE_CONNECTION_ICE
#define ICE_CONNECTION_ICE
#include <Ice/ObjectAdapterF.ice>
#include <Ice/Identity.ice>
module Ice
{
/**
*
* The user-level interface to a connection.
*
**/
local interface Connection
{
/**
*
* Close a connection, either gracefully or forcefully. If a
* connection is closed forcefully, it closes immediately, without
* sending the relevant close connection protocol messages to the
* peer and waiting for the peer to acknowledge these protocol
* messages.
*
* @param force If true, close forcefully. Otherwise the
* connection is closed gracefully.
*
**/
void close(bool force);
/**
*
* Create a special proxy that always uses this connection. This
* can be used for callbacks from a server to a client if the
* server cannot directly establish a connection to the client,
* for example because of firewalls. In this case, the server
* would create a proxy using an already established connection
* from the client.
*
* @param id The identity for which a proxy is to be created.
*
* @return A proxy that matches the given identity and uses this
* connection.
*
* @see setAdapter
*
**/
nonmutating Object* createProxy(Identity id);
/**
*
* Explicitly set an object adapter that dispatches requests that
* are received over this connection. A client can invoke an
* operation on a server using a proxy, and then set an object
* adapter for the outgoing connection that is used by the proxy
* in order to receive callbacks. This is useful if the server
* cannot establish a connection back to the client, for example
* because of firewalls.
*
* @param adapter The object adapter that should be used by this
* connection to dispatch requests. The object adapter must be
* activated. When the object adapter is deactivated, it is
* automatically removed from the connection.
*
* @see createProxy
* @see setAdapter
*
**/
void setAdapter(ObjectAdapter adapter);
/**
*
* Get the object adapter that dispatches requests for this
* connection.
*
* @return The object adapter that dispatches requests for the
* connection, or null if no adapter is set.
*
* @see setAdapter
*
**/
nonmutating ObjectAdapter getAdapter();
/**
*
* Flush any pending batch requests for this connection. This
* causes all batch requests that were sent via proxies that use
* this connection to be sent to the server.
*
**/
void flushBatchRequests();
/**
*
* Return the connection type. This corresponds to the endpoint
* type, i.e., "tcp", "udp", etc.
*
* @return The type of the connection.
*
**/
nonmutating string type();
/**
*
* Get the timeout for the connection.
*
* @return The connection's timeout.
*
**/
nonmutating int timeout();
/**
*
* Return a description of the connection as human readable text,
* suitable for logging or error messages.
*
* @return The description of the connection as human readable
* text.
*
**/
nonmutating string toString();
};
};
#endif
|