How to use the coap/common.Type.Rst function in coap

To help you get started, we’ve selected a few coap examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Kinoma / kinomajs / xs6 / sources / mc / extensions / coap / server.js View on Github external
_onReceive(request, peer) {
		let endpoint = this.endpoints[peer];

		if (request.type == Type.Ack || request.type == Type.Rst) {
			if (endpoint) {
				endpoint.dequeue(request);
			}
		} else {
			if (!endpoint) {
				endpoint = this.endpoints[peer] = new this.Endpoint(
					peer,
					this.transport,
					(err, msg) => this.handleError(err, msg)
				);
			}

			let session = this._findOrCreateSession(request, endpoint);
			this._runSession(session);
		}
	}