Ice 3.7 Slice API Reference
Loading...
Searching...
No Matches
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
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"]
30module Ice
31{
32
37["cpp:scoped", "objc:scoped"]
38local enum CompressBatch
39{
44
49
55}
56
57#if !defined(__SLICE2PHP__) && !defined(__SLICE2MATLAB__)
63local class ConnectionInfo
64{
72
80
87
94}
95#endif
96
97local interface Connection;
98
107["delegate"]
108local interface CloseCallback
109{
118 ["swift:noexcept"] void closed(Connection con);
119}
120
129["delegate"]
130local interface HeartbeatCallback
131{
139 ["swift:noexcept"] void heartbeat(Connection con);
140}
141
164
179
192
196["cpp:scoped", "objc:scoped"]
214
215#if !defined(__SLICE2PHP__) && !defined(__SLICE2MATLAB__)
221["swift:inherits:Swift.CustomStringConvertible"]
222local interface Connection
223{
232 ["cpp:noexcept", "js:async"] void close(ConnectionClose mode);
233
250 ["cpp:const", "swift:nonnull"] Object* createProxy(Identity id);
251
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
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{
477
483 int mcastPort = -1;
484
490 int rcvSize = 0;
491
497 int sndSize = 0;
498}
499
501dictionary<string, string> HeaderDict;
502
513
514#endif
515
516}
Base class providing access to the connection details.
Definition Connection.ice:64
ConnectionInfo underlying
The information of the underyling transport or null if there's no underlying transport.
Definition Connection.ice:71
string connectionId
The connection id.
Definition Connection.ice:93
string adapterName
The name of the adapter associated with the connection.
Definition Connection.ice:86
bool incoming
Whether or not the connection is an incoming or outgoing connection.
Definition Connection.ice:79
Provides access to the connection details of an IP connection.
Definition Connection.ice:428
int remotePort
The remote port.
Definition Connection.ice:439
string remoteAddress
The remote address.
Definition Connection.ice:436
string localAddress
The local address.
Definition Connection.ice:430
int localPort
The local port.
Definition Connection.ice:433
Provides access to the connection details of a TCP connection.
Definition Connection.ice:448
int rcvSize
The connection buffer receive size.
Definition Connection.ice:454
int sndSize
The connection buffer send size.
Definition Connection.ice:461
Provides access to the connection details of a UDP connection.
Definition Connection.ice:470
int rcvSize
The connection buffer receive size.
Definition Connection.ice:490
int sndSize
The connection buffer send size.
Definition Connection.ice:497
int mcastPort
The multicast port.
Definition Connection.ice:483
string mcastAddress
The multicast address.
Definition Connection.ice:476
Provides access to the connection details of a WebSocket connection.
Definition Connection.ice:509
HeaderDict headers
The headers from the HTTP upgrade request.
Definition Connection.ice:511
An application can implement this interface to receive notifications when a connection closes.
Definition Connection.ice:109
void closed(Connection con)
This method is called by the connection when the connection is closed.
The user-level interface to a connection.
Definition Connection.ice:223
ACM getACM()
Get the ACM parameters.
void setACM(optional(1) int timeout, optional(2) ACMClose close, optional(3) ACMHeartbeat heartbeat)
Set the active connection management parameters.
void throwException()
Throw an exception indicating the reason for connection closure.
string type()
Return the connection type.
Object * createProxy(Identity id)
Create a special proxy that always uses this connection.
void setAdapter(ObjectAdapter adapter)
Explicitly set an object adapter that dispatches requests that are received over this connection.
ConnectionInfo getInfo()
Returns the connection information.
void close(ConnectionClose mode)
Manually close the connection using the specified closure mode.
void setBufferSize(int rcvSize, int sndSize)
Set the connection buffer receive/send size.
ObjectAdapter getAdapter()
Get the object adapter that dispatches requests for this connection.
Endpoint getEndpoint()
Get the endpoint from which the connection was created.
void heartbeat()
Send a heartbeat message.
void setHeartbeatCallback(HeartbeatCallback callback)
Set a heartbeat callback on the connection.
void setCloseCallback(CloseCallback callback)
Set a close callback on the connection.
string toString()
Return a description of the connection as human readable text, suitable for logging or error messages...
void flushBatchRequests(CompressBatch compress)
Flush any pending batch requests for this connection.
int timeout()
Get the timeout for the connection.
The user-level interface to an endpoint.
Definition Endpoint.ice:163
An application can implement this interface to receive notifications when a connection receives a hea...
Definition Connection.ice:131
void heartbeat(Connection con)
This method is called by the connection when a heartbeat is received from the peer.
The object adapter provides an up-call interface from the Ice run time to the implementation of Ice o...
Definition ObjectAdapter.ice:50
The Ice core library.
Definition BuiltinSequences.ice:27
ACMHeartbeat
Specifies the heartbeat semantics for Active Connection Management.
Definition Connection.ice:169
@ HeartbeatAlways
Send a heartbeat at regular intervals until the connection is closed.
Definition Connection.ice:177
@ HeartbeatOnIdle
Send a heartbeat at regular intervals when the connection is idle.
Definition Connection.ice:175
@ HeartbeatOnDispatch
Send a heartbeat at regular intervals if the connection is idle and only if there are pending dispatc...
Definition Connection.ice:173
@ HeartbeatOff
Disables heartbeats.
Definition Connection.ice:171
dictionary< string, string > HeaderDict
A collection of HTTP headers.
Definition Connection.ice:501
ConnectionClose
Determines the behavior when manually closing a connection.
Definition Connection.ice:198
@ Forcefully
Close the connection immediately without sending a close connection protocol message to the peer and ...
Definition Connection.ice:203
@ GracefullyWithWait
Wait for all pending invocations to complete before closing the connection.
Definition Connection.ice:212
@ Gracefully
Close the connection by notifying the peer but do not wait for pending outgoing invocations to comple...
Definition Connection.ice:208
CompressBatch
The batch compression option when flushing queued batch requests.
Definition Connection.ice:39
@ No
Don't compress the batch requests.
Definition Connection.ice:48
@ Yes
Compress the batch requests.
Definition Connection.ice:43
@ BasedOnProxy
Compress the batch requests if at least one request was made on a compressed proxy.
Definition Connection.ice:54
ACMClose
Specifies the close semantics for Active Connection Management.
Definition Connection.ice:146
@ CloseOff
Disables automatic connection closure.
Definition Connection.ice:148
@ CloseOnIdle
Gracefully closes a connection that has been idle for the configured timeout period.
Definition Connection.ice:150
@ CloseOnInvocationAndIdle
Combines the behaviors of CloseOnIdle and CloseOnInvocation.
Definition Connection.ice:157
@ CloseOnInvocation
Forcefully closes a connection that has been idle for the configured timeout period,...
Definition Connection.ice:155
@ CloseOnIdleForceful
Forcefully closes a connection that has been idle for the configured timeout period,...
Definition Connection.ice:162
A collection of Active Connection Management configuration settings.
Definition Connection.ice:184
int timeout
A timeout value in seconds.
Definition Connection.ice:186
ACMClose close
The close semantics.
Definition Connection.ice:188
ACMHeartbeat heartbeat
The heartbeat semantics.
Definition Connection.ice:190
The identity of an Ice object.
Definition Identity.ice:40