How to use the Close function from bindings

Find comprehensive JavaScript bindings.Close code examples handpicked from public code repositorys.

189
190
191
192
193
194
195
196
197
    }
};

Socket.prototype.close = function () {
    if(!this.closed) {
        this.closed_status = nn.Close(this.binding);
        this.closed = true;
        return this.closed_status;
    }
fork icon70
star icon3
watch icon2

+ 19 other calls in file

137
138
139
140
141
142
143
144
145
146
this.destroy()

switch(this.type){
  case 'pub':
  case 'push':
    nn.Close( this.socket )
    return fn('closing a pub or a push')
  case 'pair':
    return fn(this.unhook(Math.floor(Math.random()*100000000)))
  default:
fork icon4
star icon10
watch icon7

+ 21 other calls in file

113
114
115
116
117
118
119
120
121
122
}

function close() {
  clearInterval(this.clr)
  this.open = false
  return nn.Close( this.socket )
}

function bind (addr) {
  if (nn.Bind( this.socket, addr ) < 0 || this.open)
fork icon4
star icon1
watch icon1

+ 19 other calls in file

140
141
142
143
144
145
146
147
148
149

  if ( this.type != 'pub' && this.type != 'push' ) this.unhook()

  this.sleep(10)

  this.socket = nn.Close( this.socket )
}

function shutdown(addr) {
  var confirm = this.how[addr][1] + ' endpoint '+ addr + ' shutdown'
fork icon4
star icon0
watch icon1

+ 19 other calls in file

Other functions in bindings

Sorted by popularity

function icon

bindings.createKey is the most popular function in bindings (8616 examples)