- FG_LOG( FG_IO, FG_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 ) {
- FG_LOG( FG_IO, FG_ALERT, "Error writing to socket: " << port );
- error_condition = true;
- } else {
-#ifdef _POSIX_SYNCHRONIZED_IO
- // fdatasync(msgsock);
-#else
- // fsync(msgsock);
-#endif
- }
+ if ( s->send( buf, length ) < 0 )
+ {
+ SG_LOG( SG_IO, SG_WARN, "Error writing to socket: " << port );
+ error_condition = true;