public static async Task <bool> SendResponseAsync(SerializationAdapterAsync clientMainSerializer, bool success, string message) { string response = String.Format("{0}{1}", success ? "ack" : "nack", String.IsNullOrWhiteSpace(message) ? "" : ":" + message); // add : delimiter only if there is an actual message return(await clientMainSerializer.SerializeAsync(response)); }
public async Task <bool> SendEvent_Disconnect(SerializationAdapterAsync clientEventSerializer) { string commandString = "event_disconnect"; return(await clientEventSerializer.SerializeAsync(commandString)); // There will be no response from client. }
public FtClient(SslStream sslClient) { Client = sslClient; m_readAllHelper = new ReadAggregatorWritePassthrough(sslClient); Serializer = new SerializationAdapter(m_readAllHelper); SerializerAsync = new SerializationAdapterAsync(m_readAllHelper); Deserializer = new DeserializationAdapter(m_readAllHelper); DeserializerAsync = new DeserializationAdapterAsync(m_readAllHelper); }
protected async Task <bool> sendEvent_RoomDeleted(SerializationAdapterAsync clientEventSerializer, string roomName) { string commandString = String.Format("event_room_deleted:{0}", roomName); return(await clientEventSerializer.SerializeAsync(commandString)); }
protected async Task <bool> sendEvent_MessagePersonal(SerializationAdapterAsync clientEventSerializer, string fromUsername, string messageText) { string commandString = String.Format("event_message_personal:{0}:{1}", fromUsername, messageText); return(await clientEventSerializer.SerializeAsync(commandString)); }