public void Receive(Socket client)
{
try
{
// Create the state object.
StateObject state = new StateObject();
// Begin receiving the data from the remote device.
client.BeginReceive( state.buffer, 0, StateObject.BufferSize, 0,
new AsyncCallback(ReceiveCallback), state);
}
catch (Exception ex)
{
MessageBox.Show(ex.ToString());
}
}