Spinach.AsynchronousClient.Send C# (CSharp) Method

Send() private method

private Send ( Socket client, String data ) : void
client Socket
data String
return void
        private void Send(Socket client, String data)
        {
            try
            {
                // Convert the string data to byte data using ASCII encoding.
                byte[] byteData = Encoding.ASCII.GetBytes(data);

                // Begin sending the data to the remote device.
                client.BeginSend(byteData, 0, byteData.Length, 0,
                    new AsyncCallback(SendCallback), client);
            }
            catch (Exception e)
            {
                Console.WriteLine(e.Message);
            }
        }