/////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//// This example is from the ACE Programmers Guide.
////  Chapter:  "The Acceptor/Connector"  (Connection Initialization)
//// For details please see the guide at
//// http://www.cs.wustl.edu/~schmidt/ACE.html
////  AUTHOR: Umar Syyid ([email protected])
//// and Ambreen Ilyas ([email protected])
/////////////////////////////////////////////////////////////////////////////////////////////////////////////

//Example 4 (Use in conjunction with other examples to create running example)

typedef ACE_Connector<My_Svc_Handler,ACE_SOCK_CONNECTOR> MyConnector;

int main(int argc, char * argv[]){
 ACE_INET_Addr addr(PORT_NO,HOSTNAME);
 My_Svc_Handler * handler= new My_Svc_Handler;

//Create the connector
 MyConnector connector;

//Connects to remote machine
 if(connector.connect(handler,addr)==-1)
  ACE_ERROR(LM_ERROR,?%P|%t, %p?,?Connection failed?);
 

//Registers with the Reactor
 while(1)
  ACE_Reactor::instance()->handle_events();
}

 Next Example