29 COUT<<s<<
" :\tWarning: disconnected"<<strerror( errno )<<endl;
36 <<
"------------------------------------------"<<endl
37 <<
"ServerSocketTCP for "<<
get_fd()<<
" selected"<<endl
38 <<
"------------------------------------------"<<endl
42 struct sockaddr_in remote_ip;
43 #if defined (_WIN32) || defined (MAC_OS_X_VERSION_10_3) || defined (MAC_OS_X_VERSION_10_2) || defined (MAC_OS_X_VERSION_10_1)
48 len =
sizeof (
struct sockaddr_in);
49 int sock = ::accept(
get_fd(), (sockaddr*) &remote_ip, &len );
51 COUT<<
"accepted new sock "<<sock<<endl;
54 _accepted_connections.push( newsock );
59 COUT<<
"accept failed"<<endl;
72 bool ret = (_accepted_connections.empty() ==
false);
80 if ( !_accepted_connections.empty() ) {
81 COUT<<
"A connection has been accepted"<<endl;
82 SOCKETALT ret( _accepted_connections.front() );
83 _accepted_connections.pop();
87 COUT<<
"No accepted TCP connection"<<endl;