| | 1 | | // Copyright (c) ZeroC, Inc. |
| | 2 | |
|
| | 3 | | using System.Net; |
| | 4 | |
|
| | 5 | | namespace IceRpc.Transports.Slic.Internal; |
| | 6 | |
|
| | 7 | | internal class SlicListener : IListener<IMultiplexedConnection> |
| | 8 | | { |
| 750 | 9 | | public ServerAddress ServerAddress => _duplexListener.ServerAddress; |
| | 10 | |
|
| | 11 | | private readonly IListener<IDuplexConnection> _duplexListener; |
| | 12 | | private readonly MultiplexedConnectionOptions _options; |
| | 13 | | private readonly SlicTransportOptions _slicOptions; |
| | 14 | |
|
| | 15 | | public async Task<(IMultiplexedConnection, EndPoint)> AcceptAsync(CancellationToken cancellationToken) |
| 794 | 16 | | { |
| 794 | 17 | | (IDuplexConnection duplexConnection, EndPoint remoteNetworkAddress) = |
| 794 | 18 | | await _duplexListener.AcceptAsync(cancellationToken).ConfigureAwait(false); |
| 677 | 19 | | return (new SlicConnection(duplexConnection, _options, _slicOptions, isServer: true), remoteNetworkAddress); |
| 677 | 20 | | } |
| | 21 | |
|
| 1287 | 22 | | public ValueTask DisposeAsync() => _duplexListener.DisposeAsync(); |
| | 23 | |
|
| 719 | 24 | | internal SlicListener( |
| 719 | 25 | | IListener<IDuplexConnection> duplexListener, |
| 719 | 26 | | MultiplexedConnectionOptions options, |
| 719 | 27 | | SlicTransportOptions slicOptions) |
| 719 | 28 | | { |
| 719 | 29 | | _duplexListener = duplexListener; |
| 719 | 30 | | _options = options; |
| 719 | 31 | | _slicOptions = slicOptions; |
| 719 | 32 | | } |
| | 33 | | } |