Skip to content

Commit 1bb5602

Browse files
authored
Move 'UdpTimedSender' into a named namespace.Program.cs
1 parent 8645af8 commit 1bb5602

1 file changed

Lines changed: 14 additions & 13 deletions

File tree

EchoTcpServer/Program.cs

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -112,21 +112,22 @@ public static async Task Main(string[] args)
112112
}
113113
}
114114

115-
116-
public class UdpTimedSender : IDisposable
115+
namespace EchoServerNamespace
117116
{
118-
private readonly string _host;
119-
private readonly int _port;
120-
private readonly UdpClient _udpClient;
121-
private Timer _timer;
122-
123-
public UdpTimedSender(string host, int port)
117+
public class UdpTimedSender : IDisposable
124118
{
125-
_host = host;
126-
_port = port;
127-
_udpClient = new UdpClient();
128-
}
119+
private readonly string _host;
120+
private readonly int _port;
121+
private readonly UdpClient _udpClient;
122+
private Timer _timer;
129123

124+
public UdpTimedSender(string host, int port)
125+
{
126+
_host = host;
127+
_port = port;
128+
_udpClient = new UdpClient();
129+
}
130+
}
130131
public void StartSending(int intervalMilliseconds)
131132
{
132133
if (_timer != null)
@@ -170,4 +171,4 @@ public void Dispose()
170171
StopSending();
171172
_udpClient.Dispose();
172173
}
173-
}
174+
}

0 commit comments

Comments
 (0)