Hello everybody:
I am creating a client server application Asynchronously. I am adding the asynchrous socket to the hashtable.

IAsyncResult asyncSkt = m_socListener.BeginAccept(new AsyncCallback(OnClientConnect), null);
sockettable.Add(connectId, asyncSkt);

Now I want to access the connectId from the hashtable.

Socket socket = ( Socket)sockettable[connectId];

But I am getting System.InValidCastException... Can anyone tell me what is the problem?


Pls guide...

Rahil