Skip to content

Commit

Permalink
Merge pull request #101 from isachpaz/IdleTimeout-for-DICOMSCP
Browse files Browse the repository at this point in the history
IdleTimeout added (SpinUpAssociation, DICOMSCP)
  • Loading branch information
rexcardan authored Aug 16, 2024
2 parents 07236bf + 7dd5945 commit 0e067af
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion EvilDICOM/EvilDICOM/Network/DICOMSCP.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@ public class DICOMSCP : DICOMServiceClass
private bool _started;
private bool _requestStop = false;

/// <summary>
/// IdleTimeout in milliseconds. Default value: 25000ms.
/// </summary>
public int IdleTimeout { get; set; } = 25000; // 25 sec

public DICOMSCP(Entity ae) : base(ae)
{
_server = new TcpListener(IPAddress.Parse(ApplicationEntity.IpAddress), ApplicationEntity.Port);
Expand Down Expand Up @@ -67,7 +72,7 @@ private void SpinUpAssociation(TcpClient client)
{
var asc = GenerateAssociation(client);
Logger.LogInformation(asc.ToString());
asc.Listen();
asc.Listen(TimeSpan.FromMilliseconds(IdleTimeout));
Logger.LogInformation("Closing association with {0}.", asc.IpAddress, asc.Port);
client.Close();
});
Expand Down

0 comments on commit 0e067af

Please sign in to comment.