[Ace-users] Windows Socket problem

Jeffrey S. Blatt jeffrey at blatt.org
Thu Sep 27 13:20:36 CDT 2007

I am running Microsoft Visual C++ 2003 Version 7.1.3088 on Windows XP
using ACE version 4.1 (This is the version my project is using so
upgrading is not an option)

When I run the program:

#include "ace/config.h"
#include "ace/INET_Addr.h"
#include "ace/SOCK_Stream.h"
#include "ace/SOCK_Acceptor.h"
#include "ace/Log_Msg.h"
#include "ace/Time_Value.h"
#include "ace/OS_main.h"
int ACE_TMAIN (int argc, ACE_TCHAR *argv[])
  ACE_INET_Addr port_to_listen ("9990");
  ACE_SOCK_Acceptor acceptor;

  if (acceptor.open (port_to_listen, 1) == -1)
                       ACE_TEXT ("%p\n"),
                       ACE_TEXT ("acceptor.open")),

   return 0;

I get the error:

acceptor.open: WSA Startup not initialized

I understand what the error means, I did nothing to initialize the
winsock, I thought I did not have to. I am trying to write code that
is portable between windows and linux. Am I fairly new to ACE, so I am
probably missing something stupid. Any help would be greatly
Jeffrey S. Blatt

More information about the Ace-users mailing list