-#if 0
- // check for any new client connection requests
- fd_set ready;
- FD_ZERO(&ready);
- FD_SET(sock, &ready);
- struct timeval tv;
- tv.tv_sec = 0;
- tv.tv_usec = 0;
-
- // test for any input on sock (returning immediately, even if
- // nothing)
- select(32, &ready, 0, 0, &tv);
-
- // any new connections?
- if ( FD_ISSET(sock, &ready) ) {
- int msgsock = accept(sock, 0, 0);
- if ( msgsock < 0 ) {
- SG_LOG( SG_IO, SG_ALERT,
- "Error: accept() failed in write()" );
- return 0;
- } else {
- client_connections.push_back( msgsock );
- }
- }
-
- SG_LOG( SG_IO, SG_INFO, "Client connections = " <<
- client_connections.size() );
- for ( int i = 0; i < (int)client_connections.size(); ++i ) {
- int msgsock = client_connections[i];
-
- // read and junk any possible incoming messages.
- // char junk[ SG_IO_MAX_MSG_SIZE ];
- // std::read( msgsock, junk, SG_IO_MAX_MSG_SIZE );
-
- // write the interesting data to the socket
- if ( writesocket(msgsock, buf, length) == SOCKET_ERROR ) {
- SG_LOG( SG_IO, SG_ALERT, "Error writing to socket: " << port );
- error_condition = true;
- } else {
-#ifdef _POSIX_SYNCHRONIZED_IO
- // fdatasync(msgsock);
-#else
- // fsync(msgsock);
-#endif
- }
- }
-#endif
-