PeerCastStation.FLV.RTMP.CommandMessage.Create C# (CSharp) Method

Create() public static method

public static Create ( int version, long timestamp, long stream_id, string command_name, int transaction_id, AMFValue command_object ) : CommandMessage
version int
timestamp long
stream_id long
command_name string
transaction_id int
command_object PeerCastStation.FLV.AMF.AMFValue
return CommandMessage
    public static CommandMessage Create(
      int version,
      long timestamp, 
      long stream_id, 
      string command_name,
      int transaction_id,
      AMFValue command_object,
      params AMFValue[] arguments)
    {
      switch (version) {
      case 0:
        return new CommandAMF0Message(timestamp, stream_id, command_name, transaction_id, command_object, arguments);
      case 3:
        return new CommandAMF3Message(timestamp, stream_id, command_name, transaction_id, command_object, arguments);
      default:
        throw new ArgumentException("Unsupported serialize version", "version");
      }
    }

Usage Example

Ejemplo n.º 1
0
        private async Task OnCommandCreateStream(CommandMessage msg, CancellationToken cancel_token)
        {
            var new_stream_id = nextStreamId++;
            var response      = CommandMessage.Create(
                objectEncoding,
                this.Now,
                msg.StreamId,
                "_result",
                msg.TransactionId,
                null,
                new AMF.AMFValue(new_stream_id)
                );

            if (msg.TransactionId != 0)
            {
                await SendMessage(3, response, cancel_token).ConfigureAwait(false);
            }
        }
All Usage Examples Of PeerCastStation.FLV.RTMP.CommandMessage::Create