Ice 3.7 Slice API Reference
Connection.ice
Go to the documentation of this file.
1 //
2 // Copyright (c) ZeroC, Inc. All rights reserved.
3 //
4 
5 #pragma once
6 
7 [["cpp:dll-export:ICE_API"]]
8 [["cpp:doxygen:include:Ice/Ice.h"]]
9 [["cpp:header-ext:h"]]
10 
11 [["ice-prefix"]]
12 
13 [["js:module:ice"]]
14 [["js:cjs-module"]]
15 
16 [["objc:dll-export:ICE_API"]]
17 [["objc:header-dir:objc"]]
18 
19 [["python:pkgdir:Ice"]]
20 
21 #include <Ice/ObjectAdapterF.ice>
22 #include <Ice/Identity.ice>
23 #include <Ice/Endpoint.ice>
24 
25 #ifndef __SLICE2JAVA_COMPAT__
26 [["java:package:com.zeroc"]]
27 #endif
28 
29 ["objc:prefix:ICE"]
30 module Ice
31 {
32 
37 ["cpp:scoped", "objc:scoped"]
38 local enum CompressBatch
39 {
43  Yes,
44 
48  No,
49 
55 }
56 
57 #if !defined(__SLICE2PHP__) && !defined(__SLICE2MATLAB__)
58 
63 local class ConnectionInfo
64 {
72 
79  bool incoming;
80 
86  string adapterName;
87 
93  string connectionId;
94 }
95 #endif
96 
97 local interface Connection;
98 
107 ["delegate"]
108 local interface CloseCallback
109 {
118  ["swift:noexcept"] void closed(Connection con);
119 }
120 
129 ["delegate"]
130 local interface HeartbeatCallback
131 {
139  ["swift:noexcept"] void heartbeat(Connection con);
140 }
141 
145 local enum ACMClose
146 {
163 }
164 
168 local enum ACMHeartbeat
169 {
178 }
179 
183 local struct ACM
184 {
186  int timeout;
191 }
192 
196 ["cpp:scoped", "objc:scoped"]
197 local enum ConnectionClose
198 {
213 }
214 
215 #if !defined(__SLICE2PHP__) && !defined(__SLICE2MATLAB__)
216 
221 ["swift:inherits:Swift.CustomStringConvertible"]
222 local interface Connection
223 {
232  ["cpp:noexcept", "js:async"] void close(ConnectionClose mode);
233 
250  ["cpp:const", "swift:nonnull"] Object* createProxy(Identity id);
251 
272  void setAdapter(ObjectAdapter adapter);
273 
285  ["cpp:const", "cpp:noexcept", "swift:noexcept"] ObjectAdapter getAdapter();
286 
294  ["cpp:const", "cpp:noexcept", "swift:noexcept", "swift:nonnull"] Endpoint getEndpoint();
295 
306  ["async-oneway"] void flushBatchRequests(CompressBatch compress);
307 
319 
329  ["swift:noexcept"] void setHeartbeatCallback(HeartbeatCallback callback);
330 
336  ["async-oneway"] void heartbeat();
337 
349  ["swift:noexcept", "java:optional"]
350  void setACM(optional(1) int timeout, optional(2) ACMClose close, optional(3) ACMHeartbeat heartbeat);
351 
359  ["cpp:noexcept", "swift:noexcept"] ACM getACM();
360 
369  ["cpp:const", "cpp:noexcept", "swift:noexcept"] string type();
370 
378  ["cpp:const", "cpp:noexcept", "swift:noexcept"] int timeout();
379 
389  ["cpp:const", "cpp:noexcept", "swift:noexcept"] string toString();
390 
398  ["cpp:const", "swift:nonnull"] ConnectionInfo getInfo();
399 
408  void setBufferSize(int rcvSize, int sndSize);
409 
419  ["cpp:const"] void throwException();
420 }
421 
427 local class IPConnectionInfo extends ConnectionInfo
428 {
430  string localAddress = "";
431 
433  int localPort = -1;
434 
436  string remoteAddress = "";
437 
439  int remotePort = -1;
440 }
441 
448 {
454  int rcvSize = 0;
455 
461  int sndSize = 0;
462 }
463 
470 {
476  string mcastAddress;
477 
483  int mcastPort = -1;
484 
490  int rcvSize = 0;
491 
497  int sndSize = 0;
498 }
499 
501 dictionary<string, string> HeaderDict;
502 
508 local class WSConnectionInfo extends ConnectionInfo
509 {
512 }
513 
514 #endif
515 
516 }
Ice::ConnectionInfo::connectionId
string connectionId
The connection id.
Definition: Connection.ice:93
Ice::HeaderDict
dictionary< string, string > HeaderDict
A collection of HTTP headers.
Definition: Connection.ice:501
Ice::ObjectAdapter
The object adapter provides an up-call interface from the Ice run time to the implementation of Ice o...
Definition: ObjectAdapter.ice:50
Ice::Connection::setCloseCallback
void setCloseCallback(CloseCallback callback)
Set a close callback on the connection.
Ice::Forcefully
@ Forcefully
Close the connection immediately without sending a close connection protocol message to the peer and ...
Definition: Connection.ice:203
Ice::Yes
@ Yes
Compress the batch requests.
Definition: Connection.ice:43
Ice::Connection::getAdapter
ObjectAdapter getAdapter()
Get the object adapter that dispatches requests for this connection.
Ice::HeartbeatAlways
@ HeartbeatAlways
Send a heartbeat at regular intervals until the connection is closed.
Definition: Connection.ice:177
Ice::HeartbeatOff
@ HeartbeatOff
Disables heartbeats.
Definition: Connection.ice:171
Ice::HeartbeatOnIdle
@ HeartbeatOnIdle
Send a heartbeat at regular intervals when the connection is idle.
Definition: Connection.ice:175
Ice::Connection::heartbeat
void heartbeat()
Send a heartbeat message.
Ice::CompressBatch
CompressBatch
The batch compression option when flushing queued batch requests.
Definition: Connection.ice:39
Ice::CloseOnInvocationAndIdle
@ CloseOnInvocationAndIdle
Combines the behaviors of CloseOnIdle and CloseOnInvocation.
Definition: Connection.ice:157
Ice::Connection::setBufferSize
void setBufferSize(int rcvSize, int sndSize)
Set the connection buffer receive/send size.
Ice::ConnectionInfo::underlying
ConnectionInfo underlying
The information of the underyling transport or null if there's no underlying transport.
Definition: Connection.ice:71
Ice::Connection::timeout
int timeout()
Get the timeout for the connection.
Ice::ConnectionClose
ConnectionClose
Determines the behavior when manually closing a connection.
Definition: Connection.ice:198
Ice::Gracefully
@ Gracefully
Close the connection by notifying the peer but do not wait for pending outgoing invocations to comple...
Definition: Connection.ice:208
Ice::Connection::createProxy
Object * createProxy(Identity id)
Create a special proxy that always uses this connection.
Ice::HeartbeatOnDispatch
@ HeartbeatOnDispatch
Send a heartbeat at regular intervals if the connection is idle and only if there are pending dispatc...
Definition: Connection.ice:173
Ice::UDPConnectionInfo
Provides access to the connection details of a UDP connection.
Definition: Connection.ice:470
Ice::GracefullyWithWait
@ GracefullyWithWait
Wait for all pending invocations to complete before closing the connection.
Definition: Connection.ice:212
Ice::ConnectionInfo
Base class providing access to the connection details.
Definition: Connection.ice:64
Ice::Connection::close
void close(ConnectionClose mode)
Manually close the connection using the specified closure mode.
Ice::BasedOnProxy
@ BasedOnProxy
Compress the batch requests if at least one request was made on a compressed proxy.
Definition: Connection.ice:54
Ice::CloseOff
@ CloseOff
Disables automatic connection closure.
Definition: Connection.ice:148
Ice::Connection
The user-level interface to a connection.
Definition: Connection.ice:223
Ice::CloseCallback::closed
void closed(Connection con)
This method is called by the the connection when the connection is closed.
Ice::Connection::setAdapter
void setAdapter(ObjectAdapter adapter)
Explicitly set an object adapter that dispatches requests that are received over this connection.
Ice::ACM::timeout
int timeout
A timeout value in seconds.
Definition: Connection.ice:186
Ice::Connection::getInfo
ConnectionInfo getInfo()
Returns the connection information.
Ice::IPConnectionInfo
Provides access to the connection details of an IP connection.
Definition: Connection.ice:428
Ice::ConnectionInfo::adapterName
string adapterName
The name of the adapter associated with the connection.
Definition: Connection.ice:86
Ice::WSConnectionInfo::headers
HeaderDict headers
The headers from the HTTP upgrade request.
Definition: Connection.ice:511
Ice::Connection::toString
string toString()
Return a description of the connection as human readable text, suitable for logging or error messages...
Ice::HeartbeatCallback
An application can implement this interface to receive notifications when a connection receives a hea...
Definition: Connection.ice:131
Ice::Endpoint
The user-level interface to an endpoint.
Definition: Endpoint.ice:163
Ice::Connection::getACM
ACM getACM()
Get the ACM parameters.
Ice::UDPConnectionInfo::mcastAddress
string mcastAddress
The multicast address.
Definition: Connection.ice:476
Ice::Connection::setHeartbeatCallback
void setHeartbeatCallback(HeartbeatCallback callback)
Set a heartbeat callback on the connection.
Ice::ConnectionInfo::incoming
bool incoming
Whether or not the connection is an incoming or outgoing connection.
Definition: Connection.ice:79
Ice::ACMHeartbeat
ACMHeartbeat
Specifies the heartbeat semantics for Active Connection Management.
Definition: Connection.ice:169
ObjectAdapterF.ice
Ice::ACMClose
ACMClose
Specifies the close semantics for Active Connection Management.
Definition: Connection.ice:146
Ice
The Ice core library.
Definition: BuiltinSequences.ice:27
Ice::No
@ No
Don't compress the batch requests.
Definition: Connection.ice:48
Ice::CloseOnIdle
@ CloseOnIdle
Gracefully closes a connection that has been idle for the configured timeout period.
Definition: Connection.ice:150
Ice::CloseOnInvocation
@ CloseOnInvocation
Forcefully closes a connection that has been idle for the configured timeout period,...
Definition: Connection.ice:155
Identity.ice
Ice::Connection::throwException
void throwException()
Throw an exception indicating the reason for connection closure.
Ice::TCPConnectionInfo
Provides access to the connection details of a TCP connection.
Definition: Connection.ice:448
Ice::Connection::type
string type()
Return the connection type.
Ice::ACM::heartbeat
ACMHeartbeat heartbeat
The heartbeat semantics.
Definition: Connection.ice:190
Ice::CloseCallback
An application can implement this interface to receive notifications when a connection closes.
Definition: Connection.ice:109
Ice::Connection::getEndpoint
Endpoint getEndpoint()
Get the endpoint from which the connection was created.
Endpoint.ice
Ice::WSConnectionInfo
Provides access to the connection details of a WebSocket connection.
Definition: Connection.ice:509
Ice::Identity
The identity of an Ice object.
Definition: Identity.ice:40
Ice::ACM
A collection of Active Connection Management configuration settings.
Definition: Connection.ice:184
Ice::HeartbeatCallback::heartbeat
void heartbeat(Connection con)
This method is called by the the connection when a heartbeat is received from the peer.
Ice::ACM::close
ACMClose close
The close semantics.
Definition: Connection.ice:188
Ice::CloseOnIdleForceful
@ CloseOnIdleForceful
Forcefully closes a connection that has been idle for the configured timeout period,...
Definition: Connection.ice:162
Ice::Connection::flushBatchRequests
void flushBatchRequests(CompressBatch compress)
Flush any pending batch requests for this connection.
Ice::Connection::setACM
void setACM(optional(1) int timeout, optional(2) ACMClose close, optional(3) ACMHeartbeat heartbeat)
Set the active connection management parameters.