#include <nml_srv.hh>
Inheritance diagram for NML_SERVER_LOCAL_PORT:
Public Methods | |
NML_SERVER_LOCAL_PORT (NML *_nml) | |
virtual | ~NML_SERVER_LOCAL_PORT () |
Protected Methods | |
REMOTE_READ_REPLY * | reader (REMOTE_READ_REQUEST *_req) |
REMOTE_READ_REPLY * | blocking_read (REMOTE_READ_REQUEST *_req) |
REMOTE_WRITE_REPLY * | writer (REMOTE_WRITE_REQUEST *_req) |
REMOTE_SET_DIAG_INFO_REPLY * | set_diag_info (REMOTE_SET_DIAG_INFO_REQUEST *buf) |
REMOTE_GET_DIAG_INFO_REPLY * | get_diag_info (REMOTE_GET_DIAG_INFO_REQUEST *buf) |
REMOTE_GET_MSG_COUNT_REPLY * | get_msg_count (REMOTE_GET_DIAG_INFO_REQUEST *buf) |
void | reset_diag_info () |
Protected Attributes | |
NML * | nml |
int | batch_list_id |
Friends | |
class | NML_SUPER_SERVER |
class | NML_SERVER |
|
Definition at line 149 of file nml_srv.cc. |
|
Definition at line 164 of file nml_srv.cc. |
|
Reimplemented from CMS_SERVER_LOCAL_PORT. Definition at line 175 of file nml_srv.cc. 00176 { 00177 if ((NULL == cms) || (NULL == nml)) 00178 { 00179 rcs_print_error ("NMLserver:reader: CMS object is NULL.\n"); 00180 return ((REMOTE_READ_REPLY *) NULL); 00181 } 00182 00183 /* Setup CMS channel from request arguments. */ 00184 cms->in_buffer_id = _req->last_id_read; 00185 00186 /* Read and encode the buffer. */ 00187 switch (_req->access_type) 00188 { 00189 case CMS_READ_ACCESS: 00190 nml->read (); 00191 break; 00192 case CMS_PEEK_ACCESS: 00193 nml->peek (); 00194 break; 00195 default: 00196 rcs_print_error ("NML_SERVER: Invalid access type.(%d)\n", 00197 _req->access_type); 00198 break; 00199 } 00200 00201 00202 /* Setup reply structure to be returned to remote process. */ 00203 read_reply.status = (int) cms->status; 00204 if (cms->status == CMS_READ_OLD) 00205 { 00206 read_reply.size = 0; 00207 read_reply.data = NULL; 00208 read_reply.write_id = _req->last_id_read; 00209 read_reply.was_read = 1; 00210 } 00211 else 00212 { 00213 read_reply.size = cms->header.in_buffer_size; 00214 read_reply.data = (unsigned char *) cms->encoded_data; 00215 read_reply.write_id = cms->in_buffer_id; 00216 read_reply.was_read = cms->header.was_read; 00217 } 00218 00219 /* Reply structure contains the latest shared memory info-- now 00220 return it to cms_dispatch for return to caller */ 00221 return (&read_reply); 00222 } |
|
Reimplemented from CMS_SERVER_LOCAL_PORT. Definition at line 226 of file nml_srv.cc. 00227 { 00228 if ((NULL == cms) || (NULL == nml)) 00229 { 00230 rcs_print_error ("NMLserver:blocking_read: CMS object is NULL.\n"); 00231 return ((REMOTE_READ_REPLY *) NULL); 00232 } 00233 nml->cms->first_diag_store = 0; 00234 if (_req->type != REMOTE_CMS_BLOCKING_READ_REQUEST_TYPE) 00235 { 00236 rcs_print_error ("NMLserver::blocking_read: Invalid request type(%d)\n", 00237 _req->type); 00238 return NULL; 00239 } 00240 double orig_bytes_moved = 0.0; 00241 00242 REMOTE_BLOCKING_READ_REQUEST *breq = (REMOTE_BLOCKING_READ_REQUEST *) _req; 00243 breq->_nml = new NML (nml, 1, -1); 00244 NML *nmlcopy = (NML *) breq->_nml; 00245 CMS *cmscopy = nmlcopy->cms; 00246 double blocking_timeout = (double) (breq->timeout_millis / 1000.0); 00247 REMOTE_READ_REPLY *temp_read_reply = new REMOTE_READ_REPLY (); 00248 breq->_reply = temp_read_reply; 00249 long data_size = (long) cmscopy->max_encoded_message_size; 00250 temp_read_reply->data = DEBUG_MALLOC (data_size); 00251 breq->_data = temp_read_reply->data; 00252 if ((NULL == cmscopy) || (NULL == nmlcopy)) 00253 { 00254 rcs_print_error ("NMLserver:blocking_read: CMS object is NULL.\n"); 00255 return ((REMOTE_READ_REPLY *) NULL); 00256 } 00257 if (NULL != cmscopy->handle_to_global_data) 00258 { 00259 orig_bytes_moved = cmscopy->handle_to_global_data->total_bytes_moved; 00260 } 00261 if (NULL == temp_read_reply->data) 00262 { 00263 rcs_print_error 00264 ("NMLserver:blocking_read: temp_read_reply->data object is NULL.\n"); 00265 return ((REMOTE_READ_REPLY *) NULL); 00266 } 00267 nmlcopy->cms->set_encoded_data (temp_read_reply->data, data_size); 00268 00269 /* Setup CMS channel from request arguments. */ 00270 cmscopy->in_buffer_id = _req->last_id_read; 00271 00272 /* Read and encode the buffer. */ 00273 nmlcopy->blocking_read (blocking_timeout); 00274 00275 /* Setup reply structure to be returned to remote process. */ 00276 temp_read_reply->status = (int) cmscopy->status; 00277 if (cmscopy->status == CMS_READ_OLD) 00278 { 00279 temp_read_reply->size = 0; 00280 if (NULL != temp_read_reply->data) 00281 { 00282 breq->_data = NULL; 00283 DEBUG_FREE (temp_read_reply->data); 00284 temp_read_reply->data = NULL; 00285 } 00286 temp_read_reply->write_id = _req->last_id_read; 00287 temp_read_reply->was_read = 1; 00288 } 00289 else 00290 { 00291 temp_read_reply->size = cmscopy->header.in_buffer_size; 00292 temp_read_reply->write_id = cmscopy->in_buffer_id; 00293 temp_read_reply->was_read = cmscopy->header.was_read; 00294 } 00295 if (NULL != nml->cms->handle_to_global_data && 00296 NULL != cmscopy->handle_to_global_data) 00297 { 00298 nml->cms->handle_to_global_data->total_bytes_moved 00299 += 00300 (cmscopy->handle_to_global_data->total_bytes_moved - 00301 orig_bytes_moved); 00302 nml->cms->first_diag_store = cmscopy->first_diag_store; 00303 } 00304 breq->_nml = NULL; 00305 delete nmlcopy; 00306 00307 00308 /* Reply structure contains the latest shared memory info-- now 00309 return it to cms_dispatch for return to caller */ 00310 return (temp_read_reply); 00311 } |
|
Reimplemented from CMS_SERVER_LOCAL_PORT. Definition at line 316 of file nml_srv.cc. 00317 { 00318 NMLmsg *temp; /* Temporary Pointer */ 00319 00320 if ((NULL == cms) || (NULL == nml)) 00321 { 00322 rcs_print_error ("NMLserver:writer: CMS object is NULL.\n"); 00323 return ((REMOTE_WRITE_REPLY *) NULL); 00324 } 00325 00326 temp = (NMLmsg *) cms->data; 00327 /* Check to see if remote process writing too much into local buffer. */ 00328 if (_req->size > cms_encoded_data_explosion_factor * cms->size) 00329 { 00330 rcs_print_error 00331 ("CMSserver:cms_writer: CMS buffer size is too small.\n"); 00332 return ((REMOTE_WRITE_REPLY *) NULL); 00333 } 00334 00335 /* Copy the encoded data to the location set up in CMS. */ 00336 // memcpy(cms->encoded_data, _req->data, _req->size); 00337 cms->header.in_buffer_size = _req->size; 00338 temp->size = _req->size; 00339 00340 switch (_req->access_type) 00341 { 00342 case CMS_WRITE_ACCESS: 00343 nml->write (*temp); 00344 break; 00345 case CMS_WRITE_IF_READ_ACCESS: 00346 nml->write_if_read (*temp); 00347 break; 00348 default: 00349 rcs_print_error ("NML_SERVER: Invalid Access type. (%d)\n", 00350 _req->access_type); 00351 break; 00352 } 00353 00354 write_reply.status = (int) cms->status; 00355 write_reply.was_read = cms->header.was_read; 00356 return (&write_reply); 00357 } |
|
Reimplemented from CMS_SERVER_LOCAL_PORT. Definition at line 362 of file nml_srv.cc. 00363 { 00364 if (NULL == _req) 00365 { 00366 return (NULL); 00367 } 00368 CMS_DIAG_PROC_INFO *dpi = cms->get_diag_proc_info (); 00369 if (NULL == dpi) 00370 { 00371 return (NULL); 00372 } 00373 if (orig_info == NULL) 00374 { 00375 orig_info = new CMS_DIAG_PROC_INFO (); 00376 *orig_info = *dpi; 00377 } 00378 strncpy (dpi->name, _req->process_name, 16); 00379 strncpy (dpi->host_sysinfo, _req->host_sysinfo, 32); 00380 if (cms->total_connections > _req->c_num && _req->c_num >= 0) 00381 { 00382 cms->connection_number = _req->c_num; 00383 } 00384 if (NULL != cms->handle_to_global_data) 00385 { 00386 cms->handle_to_global_data->total_bytes_moved = _req->bytes_moved; 00387 } 00388 dpi->pid = _req->pid; 00389 dpi->rcslib_ver = _req->rcslib_ver; 00390 cms->set_diag_proc_info (dpi); 00391 return (NULL); 00392 } |
|
Reimplemented from CMS_SERVER_LOCAL_PORT. Definition at line 395 of file nml_srv.cc. 00396 { 00397 get_diag_info_reply.cdi = cms->get_diagnostics_info (); 00398 get_diag_info_reply.status = cms->status; 00399 return (&get_diag_info_reply); 00400 } |
|
Reimplemented from CMS_SERVER_LOCAL_PORT. Definition at line 403 of file nml_srv.cc. 00404 { 00405 return (NULL); 00406 } |
|
Reimplemented from CMS_SERVER_LOCAL_PORT. Definition at line 409 of file nml_srv.cc. 00410 { 00411 if (NULL != orig_info) 00412 { 00413 CMS_DIAG_PROC_INFO *dpi = cms->get_diag_proc_info (); 00414 *dpi = *orig_info; 00415 cms->set_diag_proc_info (dpi); 00416 } 00417 } |
|
Definition at line 62 of file nml_srv.hh. |
|
Definition at line 63 of file nml_srv.hh. |
|
Definition at line 50 of file nml_srv.hh. |
|
Definition at line 64 of file nml_srv.hh. |