using SocketIOClient.Transport;
using System.Collections.Generic;
using System.Text;
using System.Text.Json;
namespace SocketIOClient.Messages
{
///
/// The client calls the server's callback with binary
///
public class ServerBinaryAckMessage : IMessage
{
public MessageType Type => MessageType.BinaryAckMessage;
public string Namespace { get; set; }
public List JsonElements { get; set; }
public string Json { get; set; }
public int Id { get; set; }
public int BinaryCount { get; }
public int Eio { get; set; }
public TransportProtocol Protocol { get; set; }
public List OutgoingBytes { get; set; }
public List IncomingBytes { get; set; }
public void Read(string msg)
{
}
public string Write()
{
var builder = new StringBuilder();
builder
.Append("46")
.Append(OutgoingBytes.Count)
.Append('-');
if (!string.IsNullOrEmpty(Namespace))
{
builder.Append(Namespace).Append(',');
}
builder.Append(Id);
if (string.IsNullOrEmpty(Json))
{
builder.Append("[]");
}
else
{
builder.Append(Json);
}
return builder.ToString();
}
}
}