| | | 1 | | // Copyright (c) ZeroC, Inc. |
| | | 2 | | |
| | | 3 | | namespace Ice.Internal; |
| | | 4 | | |
| | | 5 | | /// <summary> |
| | | 6 | | /// The TCP send and receive buffer sizes, as configured by the Ice.TCP.SndSize and Ice.TCP.RcvSize properties. |
| | | 7 | | /// </summary> |
| | | 8 | | internal sealed class TcpBufSize |
| | | 9 | | { |
| | | 10 | | internal int rcvSize { get; } |
| | | 11 | | |
| | | 12 | | internal int sndSize { get; } |
| | | 13 | | |
| | | 14 | | /// <summary> |
| | | 15 | | /// Initializes a new instance of the <see cref="TcpBufSize" /> class by reading the Ice.TCP.RcvSize and |
| | | 16 | | /// Ice.TCP.SndSize properties. |
| | | 17 | | /// </summary> |
| | | 18 | | /// <exception cref="PropertyException">Thrown when a property value is not a valid integer.</exception> |
| | 1 | 19 | | internal TcpBufSize(Properties properties) |
| | | 20 | | { |
| | | 21 | | // By default, on Windows we use a 128KB buffer size. On Unix platforms, we use the system defaults. |
| | 1 | 22 | | int dfltBufSize = AssemblyUtil.isWindows ? 128 * 1024 : 0; |
| | | 23 | | |
| | 1 | 24 | | rcvSize = properties.getPropertyAsIntWithDefault("Ice.TCP.RcvSize", dfltBufSize); |
| | 1 | 25 | | sndSize = properties.getPropertyAsIntWithDefault("Ice.TCP.SndSize", dfltBufSize); |
| | 1 | 26 | | } |
| | | 27 | | } |