static void Main(string[] args) { string message = "# Hack Bulgaria #"; ReceiveBuffer buffer = new ReceiveBuffer(); // Attach method as a listener buffer.MessageReceived += OnMessageRecived; // Add byte data to buffer buffer.BytesReceived(PacketGenerator.ConvertToByteArray(message)); string anotherMessage = "Programming is awesome!"; // Add new byte data to buffer buffer.BytesReceived(PacketGenerator.ConvertToByteArray(anotherMessage)); }