Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion EchoTcpServer/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
/// <summary>
/// This program was designed for test purposes only
/// Not for a review
///Test
/// </summary>
public class EchoServer
{
Expand All @@ -16,7 +17,7 @@
private CancellationTokenSource _cancellationTokenSource;


public EchoServer(int port)

Check warning on line 20 in EchoTcpServer/Program.cs

View workflow job for this annotation

GitHub Actions / Sonar Check

Non-nullable field '_listener' must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring the field as nullable.

Check warning on line 20 in EchoTcpServer/Program.cs

View workflow job for this annotation

GitHub Actions / Sonar Check

Non-nullable field '_listener' must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring the field as nullable.
{
_port = port;
_cancellationTokenSource = new CancellationTokenSource();
Expand Down Expand Up @@ -120,7 +121,7 @@
private readonly UdpClient _udpClient;
private Timer _timer;

public UdpTimedSender(string host, int port)

Check warning on line 124 in EchoTcpServer/Program.cs

View workflow job for this annotation

GitHub Actions / Sonar Check

Non-nullable field '_timer' must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring the field as nullable.

Check warning on line 124 in EchoTcpServer/Program.cs

View workflow job for this annotation

GitHub Actions / Sonar Check

Non-nullable field '_timer' must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring the field as nullable.
{
_host = host;
_port = port;
Expand All @@ -132,7 +133,7 @@
if (_timer != null)
throw new InvalidOperationException("Sender is already running.");

_timer = new Timer(SendMessageCallback, null, 0, intervalMilliseconds);

Check warning on line 136 in EchoTcpServer/Program.cs

View workflow job for this annotation

GitHub Actions / Sonar Check

Nullability of reference types in type of parameter 'state' of 'void UdpTimedSender.SendMessageCallback(object state)' doesn't match the target delegate 'TimerCallback' (possibly because of nullability attributes).

Check warning on line 136 in EchoTcpServer/Program.cs

View workflow job for this annotation

GitHub Actions / Sonar Check

Nullability of reference types in type of parameter 'state' of 'void UdpTimedSender.SendMessageCallback(object state)' doesn't match the target delegate 'TimerCallback' (possibly because of nullability attributes).
}

ushort i = 0;
Expand Down Expand Up @@ -170,4 +171,4 @@
StopSending();
_udpClient.Dispose();
}
}
}
Loading