title: C# Inconsistent accessibility : parameter type is less accessible than method
body: <p>I'm getting an error I can't find how to fix here's the code</p>
  
  <pre><code>using System;
  using System.Collections.Generic;
  using System.ComponentModel;
  using System.Data;
  using System.Drawing;
  using System.Linq;
  using System.Text;
  using System.Threading.Tasks;
  using System.Windows.Forms;
  
  namespace MITM_Omar
  {
      public partial class Form1 : Form
      {
          public Form1()
          {
              InitializeComponent();
  
          }
  
          public void button1_Click(object sender, EventArgs e)
          {
            ClientListener Client = new ClientListener();
              Client.ClientConnected += clientconnect;
          }
          public void clientconnect(ClientListener client)
          {
              ServeurListener Serveur = new ServeurListener("213.248.126.39", 5555);
              client.associated = Serveur;
              Serveur.associated = client;
              client.onReception += forwadtoserver;
              Serveur.onReception += forwadtoclient;
              Serveur.connect(); 
          }
          public void forwadtoclient(ServeurListener sender, byte[] buffer)
          {
              sender.associated.send(buffer);
          }
          public void forwadtoserver(ClientListener sender, byte[] buffer)
          {
              sender.associated.send(buffer);
          }
      }
  }
  </code></pre>
  
  <p>I get the error Inconsistent accessibility : parameter type'MITM_OMAR.ClientListener' is less accessible than method 'MITM_OMAR.Form1.clientconnect(MITM_OMAR.ClientListener)</p>
  
  <p>Here's the Client Listener class</p>
  
  <pre><code>using System;
  using System.Collections.Generic;
  using System.Linq;
  using System.Text;
  using System.Threading.Tasks;
  using System.Net.Sockets;
  using System.Threading;
  using System.Net;
  namespace MITM_Omar
  {
      class ClientListener
      {
          public Socket _Socket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
          public Thread _ConnectionThread;
          public Thread _ReceptionThread;
  
  
          public delegate void onClientActionEventHandler(ClientListener client);
          public event onClientActionEventHandler ClientConnected;
  
  
          public delegate void onTravellingDataEventHandler(ClientListener sender, byte[] buffer);
          public event onTravellingDataEventHandler onReception;
          public ServeurListener associated;
         public ClientListener()
          {
              _ConnectionThread = new Thread(new ThreadStart(accept));
              _Socket.Connect("127.0.0.1", 5555);
              _ConnectionThread.Start();
              _ReceptionThread = new Thread(new ThreadStart(Reception));
              _ReceptionThread.Start();
          }
          public void accept()
          {
              while (true)
              {
                  Socket socket = _Socket.Accept();
                  if (ClientConnected != null)
                  {
                      ClientConnected(this);
                  }
              }
  
          }
          public void send(byte[] data)
          {
              _Socket.Send(data);
  
  
          }
          public void Reception()
          {
              // On reçoit les données tant qu'on est connecté.
              while (_Socket.Connected)
              {
                  // On crée notre buffer dynamique.
                  byte[] _buffer = new byte[_Socket.Available];
  
                  // Si le buffer n'est pas vide, on le parse.
                  if (_buffer.Length != 0)
                  {
                      _Socket.Receive(_buffer); // Récéption des données.
                      if (onReception != null) onReception(this, _buffer); // un event qui dit qui a reçu des données et le tableau de bytes reçu
  
                  }
              }
          }
  
  
      }
  }
  </code></pre>