Results 1 to 30 of 97

Threaded View

  1. Collapse Details
     
    #11
    Muscle Furry 12 inch Dick juji's Avatar
    Join Date
    Dec 2011
    Posts
    17,977
    Code:
    var PORT = 44126;
    var HOST = '127.1.1.1';
    var client = dgram.createSocket('udp4');
    var play = require('play');
    
    
    client.on('listening', function () {
        var address = client.address();
        console.log('UDP Server listening on ' + address.address + ":" + address.port);
    });
    
    client.on('message', function (message, remote) {
    
        console.log(remote.address + ':' + remote.port +' - ' + message);
        play.sound('./sound-files/ring.wav');
    
    });
    
    //calling
    client.send(message, 0, message.length, PORT, HOST, function(err, bytes) {
    
        if (err) throw err;
        console.log('UDP message sent to ' + HOST +':'+ PORT);
    
    });
    No library needed to install UDP, except the audio "play" basically npm install play
    Last edited by juji; 03-17-2018 at 09:58 PM.


    Quote Originally Posted by Steffies Yelle View Post
    I'll kill myself live on cam as soon as there's proof I literlaly promise, I will sincerely kill myself as soon as I see elz's computer playing arma 3 maxed with all nvidia exclusive graphics
    Reply With Quote
     

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •