| | | 1 | | // Copyright (c) ZeroC, Inc. |
| | | 2 | | |
| | | 3 | | using System.Net; |
| | | 4 | | |
| | | 5 | | namespace Ice.Internal; |
| | | 6 | | |
| | | 7 | | // Describes transport protocol. |
| | | 8 | | public class ProtocolInstance |
| | | 9 | | { |
| | 1 | 10 | | public ProtocolInstance(Ice.Communicator communicator, short type, string protocol, bool secure) |
| | | 11 | | { |
| | 1 | 12 | | instance_ = communicator.instance; |
| | 1 | 13 | | traceLevel_ = instance_.traceLevels().network; |
| | 1 | 14 | | traceCategory_ = instance_.traceLevels().networkCat; |
| | 1 | 15 | | logger_ = instance_.initializationData().logger; |
| | 1 | 16 | | properties_ = instance_.initializationData().properties; |
| | 1 | 17 | | type_ = type; |
| | 1 | 18 | | protocol_ = protocol; |
| | 1 | 19 | | secure_ = secure; |
| | 1 | 20 | | } |
| | | 21 | | |
| | 1 | 22 | | public ProtocolInstance(Instance instance, short type, string protocol, bool secure) |
| | | 23 | | { |
| | 1 | 24 | | instance_ = instance; |
| | 1 | 25 | | traceLevel_ = instance_.traceLevels().network; |
| | 1 | 26 | | traceCategory_ = instance_.traceLevels().networkCat; |
| | 1 | 27 | | logger_ = instance_.initializationData().logger; |
| | 1 | 28 | | properties_ = instance_.initializationData().properties; |
| | 1 | 29 | | type_ = type; |
| | 1 | 30 | | protocol_ = protocol; |
| | 1 | 31 | | secure_ = secure; |
| | 1 | 32 | | } |
| | | 33 | | |
| | 1 | 34 | | public int traceLevel() => traceLevel_; |
| | | 35 | | |
| | 1 | 36 | | public string traceCategory() => traceCategory_; |
| | | 37 | | |
| | 1 | 38 | | public Ice.Logger logger() => logger_; |
| | | 39 | | |
| | 1 | 40 | | public EndpointFactory getEndpointFactory(short type) => instance_.endpointFactoryManager().get(type); |
| | | 41 | | |
| | 1 | 42 | | public string protocol() => protocol_; |
| | | 43 | | |
| | 1 | 44 | | public short type() => type_; |
| | | 45 | | |
| | 1 | 46 | | public bool secure() => secure_; |
| | | 47 | | |
| | 1 | 48 | | public Ice.Properties properties() => properties_; |
| | | 49 | | |
| | 1 | 50 | | public bool preferIPv6() => instance_.preferIPv6(); |
| | | 51 | | |
| | 1 | 52 | | public int protocolSupport() => instance_.protocolSupport(); |
| | | 53 | | |
| | 1 | 54 | | public string defaultHost() => instance_.defaultsAndOverrides().defaultHost; |
| | | 55 | | |
| | 1 | 56 | | public EndPoint defaultSourceAddress() => instance_.defaultsAndOverrides().defaultSourceAddress; |
| | | 57 | | |
| | 0 | 58 | | public Ice.EncodingVersion defaultEncoding() => instance_.defaultsAndOverrides().defaultEncoding; |
| | | 59 | | |
| | 0 | 60 | | public NetworkProxy networkProxy() => instance_.networkProxy(); |
| | | 61 | | |
| | 0 | 62 | | public int messageSizeMax() => instance_.messageSizeMax(); |
| | | 63 | | |
| | | 64 | | public void resolve(string host, int port, IPEndpointI endpt, EndpointI_connectors callback) => |
| | 1 | 65 | | instance_.endpointHostResolver().resolve(host, port, endpt, callback); |
| | | 66 | | |
| | 0 | 67 | | public BufSizeWarnInfo getBufSizeWarn(short type) => instance_.getBufSizeWarn(type); |
| | | 68 | | |
| | 0 | 69 | | public void setSndBufSizeWarn(short type, int size) => instance_.setSndBufSizeWarn(type, size); |
| | | 70 | | |
| | 0 | 71 | | public void setRcvBufSizeWarn(short type, int size) => instance_.setRcvBufSizeWarn(type, size); |
| | | 72 | | |
| | | 73 | | protected readonly Instance instance_; |
| | | 74 | | protected int traceLevel_; |
| | | 75 | | protected string traceCategory_; |
| | | 76 | | protected Ice.Logger logger_; |
| | | 77 | | protected Ice.Properties properties_; |
| | | 78 | | protected string protocol_; |
| | | 79 | | protected short type_; |
| | | 80 | | protected bool secure_; |
| | | 81 | | } |