Results 1 to 2 of 2

Thread: Storing Methods in Hashtable

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Feb 2004
    Posts
    97

    Storing Methods in Hashtable

    Hello Everybody:
    I am creating a client server application Asynchronously. I want to store the BeginAccept method in a Hashtable. But I am getting errors. Can anyone guide me what is wrong and how to store it in a hashtable.

    Thanks,

    Rahil

    Socket sckt= m_socListener.BeginAccept(new AsyncCallback ( OnClientConnect ),null);

    sockettable.Add(connectId, sckt);

    The error I am getting is

    Cannot implicitly convert type 'System.IAsyncResult' to 'System.Net.Sockets.Socket'

    Pls guide what to do..

    Rahil

  2. #2
    Junior Member
    Join Date
    Nov 2002
    Location
    New York
    Posts
    29
    Try to convert it explicitly:


    sockettable.Add(connectId, (System.Net.Sockets.Socket)sckt);
    Regards,
    Iulian
    --------------------------------------------------------
    Help beta-test PlusSuite .Net Control Library
    at http://www.olvio.com
    --------------------------------------------------------

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width