[ace-users] Unable to run simple ACE programs in cygwin

Johnny Willemsen jwillemsen at remedy.nl
Thu Jun 28 04:45:37 CDT 2007


Hi,

The cygwin port is really experimental, we do know that there are a lot of
runtime issues. Have a look at the old test stats for cygwin at the link
below, you will see there that there are a lot of test failures. There are
no plans at this moment for cygwin from our side, we do need funding to work
on this port, maybe you can provide patches to improve the port

http://www.dre.vanderbilt.edu/~remedynl/teststat/builds/WinXP_Cygwin_GCC_3_4
_4_ACE.html

Regards,

Johnny Willemsen
Remedy IT
Postbus 101
2650 AC  Berkel en Rodenrijs
The Netherlands
www.theaceorb.nl / www.remedy.nl  

*** Integrated compile and test statistics see
http://scoreboard.theaceorb.nl ***
*** Commercial service and support for ACE/TAO/CIAO             ***
*** See http://www.theaceorb.nl/en/support.html                 ***

"ananth" <ananthbv at gmail.com> wrote in message
news:<1183020603.544350.310260 at c77g2000hse.googlegroups.com>...
> Hi,
> 
> I am running a simple client and server ACE programs on cygwin.
> Compilation does not give any error. No error is shown at runtime
> also, but it does not seem to run either. When I run the server, it
> exits immediately. it does not block on 'accept' . 'echo $?' on the
> shell shows return code as 128. Here are the things I tried:
> 
> 1. 'ps -ef | grep <server / client>' does not show anything.
> 2. I ran make on the 'inserver' and 'inclient' programs in the
> 'examples' directory, ran the server and client, that also did not
> give any result (and 'ps -ef' did not show any result here too).
> 3. I put in a couple of 'printf' at the beginning of 'main', this too
> did not get printed at run-time. But commenting out all code except
> the 'printf' worked.
> 
> Can someone please help?
> 
> I am compiling the code using this command:
> g++ <server / client program name> -I/cygdrive/c/cygwin/ACE_wrappers/ /
> cygdrive/c/cygwin/ACE_wrappers/ace/libACE.dll.a
> 
> Other details:
> 
> ACE version is 5.5.9.
> 
> $ g++ --version
> g++ (GCC) 3.4.4 (cygming special, gdc 0.12, using dmd 0.125)
> Copyright (C) 2004 Free Software Foundation, Inc.
> This is free software; see the source for copying conditions.  There
> is NO
> warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR
> PURPOSE.
> $
> $ uname -a
> CYGWIN_NT-5.0 cpv2000 1.5.24(0.156/4/2) 2007-01-31 10:57 i686 Cygwin
> 
> 
> Here are the programs:
> 
> // Server
> #include "ace/INET_Addr.h"
> #include "ace/SOCK_Stream.h"
> #include "ace/SOCK_Acceptor.h"
> #include "ace/Log_Msg.h"
> int main (int, char * argv [])
> {
>         ACE_INET_Addr port_to_listen ("HAStatus");
>         ACE_SOCK_Acceptor acceptor;
> 
>         if (acceptor.open (port_to_listen, 1) == -1)
>         {
>                 ACE_ERROR ((LM_ERROR, "%p\n", "acceptor.open"));
>                 return( 100 );
>         }
> 
>         while (1)
>         {
>                 ACE_SOCK_Stream peer;
>                 ACE_INET_Addr peer_address;
>                 ACE_Time_Value timeout (10, 0);
> 
>                 if (acceptor.accept (peer, &peer_address, &timeout, 0)
> == -1)
>                 {
>                         if (ACE_OS::last_error() == EINTR)
>                                 ACE_DEBUG ((LM_DEBUG, "(%P|%t)
> Interrupted while " "waiting for client connection\n"));
>                         else if (ACE_OS::last_error() == ETIMEDOUT)
>                                 ACE_DEBUG ((LM_DEBUG, "(%P|%t) Timeout
> while " "waiting for client connection\n"));
>                 }
>                 else if (peer_address.get_port_number() == 0)
>                 {
>                         ACE_DEBUG ((LM_DEBUG, "(%P|%t) Invalid address
> for client\n"));
>                 }
>                 else if (peer.get_handle () == ACE_INVALID_HANDLE)
>                 {
>                         ACE_ERROR ((LM_ERROR, "%p\n", "accept"));
>                 }
>                 else
>                 {
>                         char buffer[4096];
>                         ssize_t bytes_received;
>                         while ((bytes_received = peer.recv (buffer,
> sizeof(buffer)-1)) != -1)
>                         {
>                                 buffer[bytes_received] = 0;
>                                 peer.send_n (buffer, bytes_received
> +1);
>                         }
>                         peer.close ();
>                 }
>         }
>         return (0);
> }
> 
> 
> 
> // Client
> #include "ace/INET_Addr.h"
> #include "ace/SOCK_Stream.h"
> #include "ace/SOCK_Connector.h"
> #include "ace/Log_Msg.h"
> 
> int main (int argc, char *argv[])
> {
>         ACE_INET_Addr srvr (50000, ACE_LOCALHOST);
>         ACE_SOCK_Connector connector;
>         ACE_SOCK_Stream peer;
> 
>         if (-1 == connector.connect (peer, srvr))
>                 ACE_ERROR_RETURN ((LM_ERROR, "%p\n", "connect"), 1);
> 
>         int bc;
>         char buf[64];
> 
>         peer.send_n ("uptime\n", 7);
>         bc = peer.recv (buf, sizeof(buf));
>         write (1, buf, bc);
>         peer.close ();
>         return (0);
> }
> 



More information about the Ace-users mailing list