CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Nov 2011
    Posts
    72

    CAsyncSocket::Create arguments

    Windows XP, visual Studio 2009, C++, object: creating a simple non blocking server class.

    After instantiating the CAsyncSocket Create is called. But the options are not all explained. From the help file:
    Code:
    BOOL Create(
       UINT nSocketPort = 0,
       int nSocketType = SOCK_STREAM,
       long lEvent = FD_READ | FD_WRITE | FD_OOB | FD_ACCEPT | FD_CONNECT | FD_CLOSE,
       LPCTSTR lpszSocketAddress = NULL 
    );
    What is the purpose of the last argument, lpszSocketAddress? My searches have been futile.

    Motivation: Several computers pass telemetry data and my server app will feed a computer that processes the data. I want the high data rate channel to use a particular connection between the two computers. If I put the IP address of 192.10.10.50 in this argument, will that serve to, or assist in, guarenteeing that this data path will use that IP address?

    This is the server end of that conversation it so the third argument will be FD_ACCEPT. Is that correct?

  2. #2
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    20,396

    Re: CAsyncSocket::Create arguments

    1. What is "visual Studio 2009"? Does it exist?
    2. From MSDN:
      lpszSockAddress
      A pointer to a string containing the network address of the connected socket, a dotted number such as "128.56.22.8". Passing the NULL string for this parameter indicates the CAsyncSocket instance should listen for client activity on all network interfaces.
    Victor Nijegorodov

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