-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathListenerTask.cs
More file actions
51 lines (45 loc) · 2.06 KB
/
ListenerTask.cs
File metadata and controls
51 lines (45 loc) · 2.06 KB
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
////////////////////////////////////////////////////////////////////////////////////////////////////
// file: ListenerTask.cs
//
// summary: Implements the listener task class
////////////////////////////////////////////////////////////////////////////////////////////////////
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net.Sockets;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
namespace Muster
{
/// <summary> A listener task. </summary>
class ListenerTask
{
/// <summary> A listener configuration. </summary>
internal class ListenerConfig
{
////////////////////////////////////////////////////////////////////////////////////////////////////
/// <summary> Method to call to broadcast that socket is alive. </summary>
///
/// <param name="peerChannel"> The peer channel. </param>
////////////////////////////////////////////////////////////////////////////////////////////////////
public delegate void BroadcastAlive(int peerChannel);
////////////////////////////////////////////////////////////////////////////////////////////////////
/// <summary> Bell strike. </summary>
///
/// <param name="keyStroke"> The key stroke. </param>
////////////////////////////////////////////////////////////////////////////////////////////////////
public delegate void BellStrike(char keyStroke);
/// <summary> A token that allows processing to be cancelled. </summary>
public CancellationToken cancellationToken;
/// <summary> Source socket. </summary>
public Socket srcSocket;
/// <summary> The peer channel. </summary>
public int peerChannel;
/// <summary> The echo back event. </summary>
public BroadcastAlive EchoBackEvent;
/// <summary> The bell strike event. </summary>
public BellStrike BellStrikeEvent;
}
}
}