lib/services.js
function createReaders(clientSvc, serverSvc) {
  var obj = {};
  clientSvc.messages.forEach(function (c) {
    var n = c.name;
    var s = serverSvc.message(n);
    try {
      if (!s) {
        throw new Error(f('missing server message: %s', n));
      }
      if (s.oneWay !== c.oneWay) {
        throw new Error(f('inconsistent one-way message: %s', n));
      }
      obj[n + '?'] = createReader(s.requestType, c.requestType);
      obj[n + '*'] = createReader(c.errorType, s.errorType);
      obj[n + '!'] = createReader(c.responseType, s.responseType);
    } catch (cause) {
      throw toRpcError('INCOMPATIBLE_PROTOCOL', cause);
    }
  });
  return obj;
}
function createReaders(clientSvc, serverSvc) {
  var obj = {};
  clientSvc.messages.forEach(function (c) {
    var n = c.name;
    var s = serverSvc.message(n);
    try {
      if (!s) {
        throw new Error(f('missing server message: %s', n));
      }
      if (s.oneWay !== c.oneWay) {
        throw new Error(f('inconsistent one-way message: %s', n));
      }
      obj[n + '?'] = createReader(s.requestType, c.requestType);
      obj[n + '*'] = createReader(c.errorType, s.errorType);
      obj[n + '!'] = createReader(c.responseType, s.responseType);
    } catch (cause) {
      throw toRpcError('INCOMPATIBLE_PROTOCOL', cause);
    }
  });
  return obj;
}
function createReaders ( clientSvc , serverSvc ) { var obj = { } ; clientSvc . messages . forEach ( function ( c ) { var n = c . name ; var s = serverSvc . message ( n ) ; try { if ( ! s ) { throw new Error ( f ( 'missing server message: %s' , n ) ) ; } if ( s . oneWay !== c . oneWay ) { throw new Error ( f ( 'inconsistent one-way message: %s' , n ) ) ; } obj [ n + '?' ] = createReader ( s . requestType , c . requestType ) ; obj [ n + '*' ] = createReader ( c . errorType , s . errorType ) ; obj [ n + '!' ] = createReader ( c . responseType , s . responseType ) ; } catch ( cause ) { throw toRpcError ( 'INCOMPATIBLE_PROTOCOL' , cause ) ; } } ) ; return obj ; }
Generate all readers for a given protocol combination.

@param clientSvc {Service} Client service.
@param serverSvc {Service} Client service.
Generate all readers for a given protocol combination .