Lines Matching defs:message

93     send(message, handle, options) {
97 got(message, handle, emit) {
105 send(message, server, options) {
109 got(message, handle, emit) {
118 send(message, socket, options) {
125 message.key = socket.server._connectionKey;
127 const firstTime = !this[kChannelHandle].sockets.send[message.key];
128 const socketList = getSocketList('send', this, message.key);
166 postSend(message, handle, options, callback, target) {
177 { callback, message, handle, options, retransmissions: 0 };
184 got(message, handle, emit) {
192 if (message.key) {
195 const socketList = getSocketList('got', this, message.key);
208 send(message, handle, options) {
212 got(message, handle, emit) {
220 send(message, socket, options) {
221 message.dgramType = socket.type;
226 got(message, handle, emit) {
227 const socket = new dgram.Socket(message.dgramType);
617 for (const message of parseChannelMessages(channel, pool)) {
618 // There will be at most one NODE_HANDLE message in every chunk we
620 // that we deliver the handle with the right message however.
621 if (isInternal(message)) {
622 if (message.cmd === 'NODE_HANDLE') {
623 handleMessage(message, pendingHandle, true);
626 handleMessage(message, undefined, true);
629 handleMessage(message, undefined, false);
646 target.on('internalMessage', function(message, handle) {
648 if (message.cmd === 'NODE_HANDLE_ACK' ||
649 message.cmd === 'NODE_HANDLE_NACK') {
652 if (message.cmd === 'NODE_HANDLE_ACK') {
667 target._send(target._pendingMessage.message,
675 target._send(args.message, args.handle, args.options, args.callback);
685 if (message.cmd !== 'NODE_HANDLE') return;
689 // sender about it by sending a NODE_HANDLE_NACK message.
696 // a message.
699 const obj = handleConversion[message.type];
707 obj.got.call(this, message, handle, (handle) => {
708 handleMessage(message.msg, handle, isInternal(message.msg));
715 if (!target.channel || !target.listenerCount('message'))
730 target.send = function(message, handle, options, callback) {
745 return this._send(message, handle, options, callback);
756 target._send = function(message, handle, options, callback) {
759 if (message === undefined)
760 throw new ERR_MISSING_ARGS('message');
764 // will result in error message that is weakly consumable.
765 // So perform a final check on message prior to sending.
766 if (typeof message !== 'string' &&
767 typeof message !== 'object' &&
768 typeof message !== 'number' &&
769 typeof message !== 'boolean') {
771 'message', ['string', 'object', 'number', 'boolean'], message);
783 // This message will be handled by an internalMessage event handler
784 message = {
787 msg: message,
791 message.type = 'net.Socket';
793 message.type = 'net.Server';
795 message.type = 'net.Native';
797 message.type = 'dgram.Socket';
799 message.type = 'dgram.Native';
804 // Queue-up message and handle if we haven't received ACK yet.
810 message: message.msg,
815 obj = handleConversion[message.type];
818 handle = ReflectApply(handleConversion[message.type].send,
819 target, [message, handle, options]);
824 message = message.msg;
831 !(message && (message.cmd === 'NODE_HANDLE_ACK' ||
832 message.cmd === 'NODE_HANDLE_NACK'))) {
838 message: message,
845 const err = writeChannelMessage(channel, req, message, handle);
853 obj.postSend(message, handle, options, callback, target);
869 obj.postSend(message, handle, options, callback);
931 // If a message is being read, then wait for it to complete.
933 this.once('message', finish);
942 function emit(event, message, handle) {
943 if ('internalMessage' === event || target.listenerCount('message')) {
944 target.emit(event, message, handle);
950 [event, message, handle],
954 function handleMessage(message, handle, internal) {
958 const eventName = (internal ? 'internalMessage' : 'message');
960 process.nextTick(emit, eventName, message, handle);
968 function isInternal(message) {
969 return (message !== null &&
970 typeof message === 'object' &&
971 typeof message.cmd === 'string' &&
972 message.cmd.length > INTERNAL_PREFIX.length &&
973 StringPrototypeSlice(message.cmd, 0, INTERNAL_PREFIX.length) ===