public GET(IConnection con, ContentInfo info, SegmentInfo segment, string type) : base(con, null) { string req = null; if (info.ContainsKey(ContentInfo.REQUEST)) req = info.Get(ContentInfo.REQUEST); else if (info.ContainsKey(ContentInfo.TTH)) req = info.Get(ContentInfo.TTH); else if (info.ContainsKey(ContentInfo.VIRTUAL)) req = info.Get(ContentInfo.VIRTUAL); if (req == null) throw new System.ArgumentException("ContentInfo must contain any of: REQUEST, TTH or VIRTUAL"); // TODO : Add support for list also Raw = string.Format("CGET {0} {1} {2} {3}\n", type, req, segment.Position, segment.Length); }
public GET(IConnection con, ContentInfo info, SegmentInfo segment) : this(con, info, segment, "file") { }
public SND(IConnection con, string raw) : base(con, raw) { if (param.Count >= 4) { contentType = param[0]; identifier = param[1]; try { long start = int.Parse(param[2]); long length = int.Parse(param[3]); segment = new SegmentInfo(-1, start, length); valid = true; } catch { } } }
public SND(IConnection con, string contentType, string identifier, SegmentInfo info) : base(con, null) { this.contentType = contentType; this.identifier = identifier; this.segment = info; Raw = string.Format("CSND {0} {1} {2} {3}\n", contentType, identifier, info.Start, info.Length); }
public UploadItem(ContentInfo content, Source src, SegmentInfo seg) { ContentInfo = content; Source = src; Segment = seg; }
public bool verifySegment(ref FlowLib.Containers.ContentInfo info, FlowLib.Containers.SegmentInfo seg) { throw new System.Exception("The method or operation is not implemented."); }