3 * Copyright 2019 AT&T Intellectual Property
6 * Licensed under the Apache License, Version 2.0 (the "License");
7 * you may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
10 * http://www.apache.org/licenses/LICENSE-2.0
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
20 // :vim ts=4 sw=4 noet:
22 Mnemonic: dummy_rcvr.c
23 Abstract: RMr receiver that discards everything.
25 Define these environment variables to have some control:
26 RMR_SEED_RT -- path to the static routing table
27 RMR_RTG_SVC -- host:port of the route table generator
30 Author: E. Scott Daniels
43 int main( int argc, char** argv ) {
44 void* mrc; // msg router context
45 rmr_mbuf_t* msg = NULL; // message received
50 if( (listen_port = getenv( "DUMMY_RCVR_PORT" )) == NULL ) {
51 listen_port = "19289";
54 mrc = rmr_init( listen_port, RMR_MAX_RCV_BYTES, RMRFL_NONE ); // start your engines!
56 fprintf( stderr, "<RCVR> ABORT: unable to initialise RMr\n" );
60 while( ! rmr_ready( mrc ) ) {
61 fprintf( stderr, "<RCVR> waiting for RMr to show ready\n" );
64 fprintf( stderr, "<RCVR> RMr now shows ready\n" );
66 fprintf( stderr, "<RCVR> listening on %s build=%s @ %s\n", listen_port, __DATE__, __TIME__ );
69 msg = rmr_rcv_msg( mrc, msg ); // block until one arrives
71 //if( count % 1000 == 0 ) {
72 fprintf( stderr, "receiver received: %d\n", count );