Results 1 to 2 of 2

Thread: Server connecting to multiple clients async

  1. #1

    Thread Starter
    Lively Member reado's Avatar
    Join Date
    Mar 2005
    Posts
    78

    Server connecting to multiple clients async

    Hi,
    I am pretty new to C#.net, from a vb6 background. I am needing to write a windows service that will, when started, start trying to connect to many clients using TCPIP on different ip's and port numbers. I think I'm pretty ok with the service side of things, but am wondering the best way to connect to the remote clients, would I use threading?

    Many thinks

    c#.net version will be the latest there is no restriction on which version I use
    Last edited by reado; Jan 13th, 2010 at 10:47 AM.

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: Server connecting to multiple clients async

    The TcpListener and TcpClient classes support asynchronous methods, so there's no need to implement multi-threading explicitly. Follow the VB CodeBank link in my signature and check out the Asynchronous Client/Server submission. The code is in VB but the principles are all the same, so you can see which methods to call and how to call them. If you need further help then feel free to ask more specific questions.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

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