CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Sep 2006
    Posts
    12

    SocketServer getting delay to listen client when if restart the server PC

    Hi,

    I have followed the article Asynchronous Socket Programming in C#: Part II
    (link: http://www.codeguru.com/csharp/cshar...cle.php/c8781/)

    I need to place the SocketServer application in a PC startup menu. So that once the SocketServer application is started after restarting the PC, the client machine can connect to server and communicate.

    But I have a Client connection problem when SocketServer application luanches immediately after restarting the SocketServer application PC.

    I mean when I press "Connect to Server" Button from the Client application Immediately after the SocketServer application launches after restarting that PC, The client is not connecting to server application immediately.

    I need to wait at least 15 to 20 second to get the connection from Client PC to Server. But after that it works fine.


    Only I face delay first time if I am trying to connect from client machine to server, When Server machine restarting.

    How can I avoid this delay please help on this.

  2. #2
    Join Date
    Apr 2005
    Location
    Norway
    Posts
    3,934

    Re: SocketServer getting delay to listen client when if restart the server PC

    One can only guess what the problem is. Maybe the network connection isn't properly up and running, thus the server cannot be reached.

    - petter

  3. #3
    Arjay's Avatar
    Arjay is offline Moderator / EX MS MVP Power Poster
    Join Date
    Aug 2004
    Posts
    13,490

    Re: SocketServer getting delay to listen client when if restart the server PC

    You may need to wait until some dependent Windows services startup.

    I would put your source code into a Windows Service and specify those dependent services and the Service Controll Manager will start your service in the proper order.

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

Featured