Gets or sets the DICOM Socket options.
public DicomSocketOptions SocketOptions { get; set; } Public Property SocketOptions As Leadtools.Dicom.DicomSocketOptions public:property Leadtools.Dicom.DicomSocketOptions SocketOptions {Leadtools.Dicom.DicomSocketOptions get();void set ( Leadtools.Dicom.DicomSocketOptions value);}
The DICOM socket options to use when calling DicomNet.Connect().
This property contains the socket options that will be used when calling DicomNet.Connect(). Internally, the socket is created when calling DicomNet.Connect(). Therefore, if you do not want to use the default socket options, you must set the SocketOptions before calling DicomNet.Connect().
This example will change the socket options before calling DicomNet.Connect
using Leadtools;using Leadtools.Dicom;void DisplaySocketOptions(DicomSocketOptions options){string sMsg = string.Format("Socket Options:\n\tnSendBufferSize: {0}\n\tnReceiveBufferSize: {1}\n\tbNoDelay: {2}",options.SendBufferSize,options.ReceiveBufferSize,options.NoDelay);MessageBox.Show(sMsg, "Socket Options", MessageBoxButtons.OK);}public void SocketOptionsSample(){DicomEngine.Startup();DicomNet.Startup();using (DicomNet net = new DicomNet(Path.Combine(LEAD_VARS.ImagesDir, "temp"), DicomNetSecurityeMode.None)){DicomSocketOptions options = net.DefaultSocketOptions;// Display the default socket optionsDisplaySocketOptions(options);// Set the socket options before calling Connectoptions.SendBufferSize = options.SendBufferSize * 2;net.SocketOptions = options;// Display the new socket optionsDisplaySocketOptions(net.SocketOptions);//connect to a server using the new socket optionsnet.Connect(null, 1000, "127.0.0.1", 104);// ...// ...// ...net.Close();}DicomEngine.Shutdown();DicomNet.Shutdown();}static class LEAD_VARS{public const string ImagesDir = @"C:\Users\Public\Documents\LEADTOOLS Images";}
Imports LeadtoolsImports Leadtools.DicomPrivate Sub DisplaySocketOptions(ByVal options As DicomSocketOptions)Dim sMsg As String = String.Format("Socket Options:" & Constants.vbLf + Constants.vbTab & "nSendBufferSize: {0}" & Constants.vbLf + Constants.vbTab &"nReceiveBufferSize: {1}" & Constants.vbLf + Constants.vbTab & "bNoDelay: {2}", options.SendBufferSize,options.ReceiveBufferSize, options.NoDelay)MessageBox.Show(sMsg, "Socket Options", MessageBoxButtons.OK)End SubPublic Sub SocketOptionsSample()DicomEngine.Startup()DicomNet.Startup()Dim net As DicomNet = New DicomNet(Path.Combine(LEAD_VARS.ImagesDir, "temp"), DicomNetSecurityeMode.None)TryDim options As DicomSocketOptions = net.DefaultSocketOptions' Display the default socket optionsDisplaySocketOptions(options)' Set the socket options before calling Connectoptions.SendBufferSize = options.SendBufferSize * 2net.SocketOptions = options' Display the new socket optionsDisplaySocketOptions(net.SocketOptions)'connect to a server using the new socket optionsnet.Connect(Nothing, 1000, "127.0.0.1", 104)' ...' ...' ...net.Close()FinallyCType(net, IDisposable).Dispose()End TryDicomEngine.Shutdown()DicomNet.Shutdown()End SubPublic NotInheritable Class LEAD_VARSPublic Const ImagesDir As String = "C:\Users\Public\Documents\LEADTOOLS Images"End Class
Raster .NET | C API | C++ Class Library | JavaScript HTML5
Document .NET | C API | C++ Class Library | JavaScript HTML5
Medical .NET | C API | C++ Class Library | JavaScript HTML5
Medical Web Viewer .NET
