Example #1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="SocketMessage"/> class.
 /// </summary>
 public SocketMessage(int type, int length, RequestHandle handle, bool faulted = false)
 {
     this.MessageTypeId = type;
     this.MessageLength = length;
     this.Handle = handle;
     this.Faulted = faulted;
 }
Example #2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="SocketMessage"/> class.
        /// </summary>
        public SocketMessage(int operation, int length, byte[] data, RequestHandle handle, bool faulted = false)
            : this(operation, length, handle, faulted)
        {
            if (data == null)
            {
                throw new ArgumentNullException(nameof(data));
            }

            this.receiveStream = this.CreateStream();
            this.receiveStream.Write(data, 0, data.Length);

            this.receiveStream.Position = 0;
        }
Example #3
0
 public FileMessage(int operation, int length, string filename, RequestHandle handle)
     : base(operation, length, handle)
 {
     this.Filename = filename;
 }
Example #4
0
 public FileMessage(int operation, int length, RequestHandle handle)
     : base(operation, length, handle)
 {
     this.Filename = Path.GetTempFileName();
 }
Example #5
0
 /// <summary>
 /// Initializes a new instance of the <see cref="SocketMessage"/> class.
 /// </summary>
 public SocketMessage(int operation, int length, Stream stream, RequestHandle handle, bool faulted = false)
     : this(operation, length, handle, faulted)
 {
     this.receiveStream = stream;
 }