←Select platform

TargetID Property

Summary
Gets or sets the target ID which identifies the logical target.

Syntax
C#
C++/CLI
Python
public string TargetID { get; set; } 
public: 
property String^ TargetID { 
   String^ get(); 
   void set (    String^ ); 
} 
TargetID # get and set (TargetFields) 

Property Value

A System.String to absolutely identify the logical target that is being accessed, including any discretionary trans-coding performed by the server.

Remarks

This field may be used to supply a unique ID string, which was generated by the server in a previous response. The TargetID uniquely identifies the logical target that is being requested at the server level.

Don't depend on the Target field to identify the image, since the same Target value will exists for requests with different ImageReturnTypes or different trans-coding.

If this field is "0", the logical target is specified through the use of the Target, SubTarget and JPIP URL path component, and the client is explicitly requesting that the server inform it of the assigned target-ID, if there is one.

Example
C#
using Leadtools; 
using Leadtools.Codecs; 
using Leadtools.Jpip; 
using Leadtools.Jpip.Caching; 
using Leadtools.Jpip.HttpServer; 
using Leadtools.Jpip.RequestDecoder; 
using Leadtools.Jpip.RequestEncoder; 
using Leadtools.Jpip.Client.WinForms; 
using Leadtools.Jpip.Client.InteractiveDecoder; 
using Leadtools.Jpip.Server; 
using Leadtools.Jpip.Logging; 
 
public void SendClientRequest() 
{ 
   Leadtools.Examples.Support.SetLicense(); 
   RequestFields fields = new RequestFields(); 
   ModelItem cacheModleItem; 
   ExplicitBinDescriptor binDescriptor; 
   ModelElement cacheModleElement; 
 
   fields.RequestTargetFields = new TargetFields("0", "image1.jp2", null); 
   fields.RequestChannelFields.NewChannel = new string[] { "http" }; 
   fields.RequestDataLimitFields.DataLength = 16384; 
   cacheModleItem = new ModelItem(); 
   binDescriptor = new ExplicitBinDescriptor(ExplicitBin.MetaBin, 0, null); //indicate that metadata bin 0 is locally cached and need not be sent. 
   cacheModleElement = new ModelElement(false, binDescriptor); 
   cacheModleItem.BinDescriptors.Add(cacheModleElement); 
   cacheModleItem.CodeStreamRange.Add(new Range(0, 0)); 
   fields.RequestCacheManagementFields.ModelItems.Add(cacheModleItem); 
   ImageReturnType imageType = new ImageReturnType(ImageTypes.JppStream, false); 
   fields.RequestServerControlFields.ImageReturnTypes = new ImageReturnType[] { imageType }; 
   fields.RequestViewWindowFields.FrameSize = new LeadSize(500, 300); 
   fields.RequestViewWindowFields.RegionOffset = new LeadPoint(0, 100); 
   fields.RequestViewWindowFields.FrameSizeRoundingDirection = RoundingDirection.Closest; 
   SampleRange codeStreamRange = new SampleRange(); 
   codeStreamRange.Range = new Range(0, 0); 
   fields.RequestViewWindowFields.CodeStream.Add(codeStreamRange); 
   HttpRequestEncoder encoder = new HttpRequestEncoder(IPAddress.Parse("127.0.0.1"), 108); 
   HttpWebRequest request = encoder.Encode(fields, "jpip", null); 
   Console.WriteLine(request.Address.ToString()); 
   HttpWebResponse response = (HttpWebResponse)request.GetResponse(); 
   Console.WriteLine("Server response received."); 
   Console.WriteLine(response.Headers.ToString()); 
} 
 
public Socket GetClientSocket() 
{ 
   Socket listenSocket = new Socket(AddressFamily.InterNetwork, 
                                     SocketType.Stream, 
                                     ProtocolType.Tcp); 
   IPAddress hostIP = IPAddress.Parse("127.0.0.1"); 
   int port = 107; 
   IPEndPoint ep = new IPEndPoint(hostIP, port); 
   listenSocket.Bind(ep); 
   // start listening 
   listenSocket.Listen(10); 
   //a client should send a request to the listening address 
   Socket client = listenSocket.Accept(); 
   listenSocket.Close(); 
   return client; 
} 
Requirements

Target Platforms

Help Version 22.0.2023.3.31
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.

Leadtools.Jpip Assembly
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.