-
Notifications
You must be signed in to change notification settings - Fork 966
/
IChannel.cs
70 lines (43 loc) · 1.68 KB
/
IChannel.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
namespace DotNetty.Transport.Channels
{
using System;
using System.Net;
using System.Threading.Tasks;
using DotNetty.Buffers;
using DotNetty.Common.Utilities;
public interface IChannel : IAttributeMap, IComparable<IChannel>
{
IChannelId Id { get; }
IByteBufferAllocator Allocator { get; }
IEventLoop EventLoop { get; }
IChannel Parent { get; }
bool Open { get; }
bool Active { get; }
bool Registered { get; }
/// <summary>
/// Return the <see cref="ChannelMetadata" /> of the <see cref="IChannel" /> which describe the nature of the
/// <see cref="IChannel" />.
/// </summary>
ChannelMetadata Metadata { get; }
EndPoint LocalAddress { get; }
EndPoint RemoteAddress { get; }
bool IsWritable { get; }
IChannelUnsafe Unsafe { get; }
IChannelPipeline Pipeline { get; }
IChannelConfiguration Configuration { get; }
Task CloseCompletion { get; }
Task DeregisterAsync();
Task BindAsync(EndPoint localAddress);
Task ConnectAsync(EndPoint remoteAddress);
Task ConnectAsync(EndPoint remoteAddress, EndPoint localAddress);
Task DisconnectAsync();
Task CloseAsync();
// todo: make these available through separate interface to hide them from public API on channel
IChannel Read();
Task WriteAsync(object message);
IChannel Flush();
Task WriteAndFlushAsync(object message);
}
}