| 156 | } |
| 157 | |
| 158 | int |
| 159 | InfoRepoMulticastResponder::handle_input(ACE_HANDLE) |
| 160 | { |
| 161 | if (OpenDDS::DCPS::DCPS_debug_level > 0) |
| 162 | ACE_DEBUG((LM_DEBUG, "Entered InfoRepoMulticastResponder::handle_input\n")); |
| 163 | |
| 164 | // The length of the service name string that follows. |
| 165 | ACE_CDR::UShort header; |
| 166 | // Port to which to reply. |
| 167 | ACE_UINT16 remote_port; |
| 168 | // Name of the service for which the client is looking. |
| 169 | char object_key[BUFSIZ]; |
| 170 | |
| 171 | ACE_INET_Addr remote_addr; |
| 172 | |
| 173 | // Take a peek at the header to find out how long is the service |
| 174 | // name string we should receive. |
| 175 | ssize_t n = this->mcast_dgram_.recv(&header, |
| 176 | sizeof(header), |
| 177 | remote_addr, |
| 178 | MSG_PEEK); |
| 179 | |
| 180 | if (n <= 0) |
| 181 | ACE_ERROR_RETURN((LM_ERROR, |
| 182 | "InfoRepoMulticastResponder::handle_input - peek %d\n", |
| 183 | n), |
| 184 | 0); |
| 185 | |
| 186 | else if (ACE_NTOHS(header) <= 0) |
| 187 | ACE_ERROR_RETURN((LM_ERROR, |
| 188 | "InfoRepoMulticastResponder::handle_input() Header value < 1\n"), |
| 189 | 0); |
| 190 | |
| 191 | // Receive full client multicast request. |
| 192 | const int iovcnt = 3; |
| 193 | iovec iov[iovcnt]; |
| 194 | |
| 195 | iov[0].iov_base = (char *) &header; |
| 196 | iov[0].iov_len = sizeof(header); |
| 197 | iov[1].iov_base = (char *) &remote_port; |
| 198 | iov[1].iov_len = sizeof(ACE_UINT16); |
| 199 | iov[2].iov_base = (char *) object_key; |
| 200 | iov[2].iov_len = ACE_NTOHS(header); |
| 201 | |
| 202 | // Read the iovec. |
| 203 | n = this->mcast_dgram_.recv(iov, |
| 204 | iovcnt, |
| 205 | remote_addr); |
| 206 | |
| 207 | if (n <= 0) |
| 208 | ACE_ERROR_RETURN((LM_ERROR, |
| 209 | "InfoRepoMulticastResponder::handle_input recv = %d\n", |
| 210 | n), |
| 211 | 0); |
| 212 | |
| 213 | if (OpenDDS::DCPS::DCPS_debug_level > 0) { |
| 214 | ACE_DEBUG((LM_DEBUG, |
| 215 | "(%P|%t) Received multicast from %C.\n" |
nothing calls this directly
no test coverage detected