Page 2 of 2 FirstFirst 12
Results 11 to 16 of 16
  1. #11

    Default Re: Listening to a UDP Socket using PHP...


    question lang, is this to be deployed online or just fun project lang...

  2. #12

    Default Re: Listening to a UDP Socket using PHP...

    Quote Originally Posted by stealthghost View Post
    up ta ni beh..! kinsa to maayu diha og PHP?

    wa ko time mo-suway man gud og PHP Socket Programming..

    atong tabangan si red_horse..

    Salamat kaayo bro.
    Naa daw kuno bayad, hehehe.
    Dili man ko magpa spoonfeed.
    Ang ako lang bisan mangayo lang ko idea or links about this, if wa ok lang sad.
    Naa nako nakit-an bro, pero TCP/IP protocol ang gamit.
    So maybe ako nalang paningkamutan na katong ENC+PIC maka communicate sa server using TCP/IP protocol.


    Quote Originally Posted by salbahis View Post
    question lang, is this to be deployed online or just fun project lang...
    Gamiton ni sya sa project study master salbahis.
    Datalogger project. Wind speed/direction, level and temperature.
    Then ang mga users adto na sa website mo access if ganahan sila molantaw sa data.

    Something like this, Sending temperature data from the arduino to a server .

    Anyways thanks, thanks, thanks sa mga nag reply.

  3. #13

    Default Re: Listening to a UDP Socket using PHP...

    Bro, try daw ug node.js... Nindot siiya nga language for developing network apps... ECMAScript (JavaScript) iya gigamit, but you can write a web server (or a utility that sends UDP datagrams, in your case) in less than a dozen lines.

    Naay sample code sa documentation for creating a UDP server that listens to port 41234:

    Code:
    var dgram = require("dgram");
    
    
    var server = dgram.createSocket("udp4");
    
    
    server.on("message", function (msg, rinfo) {
      console.log("server got: " + msg + " from " +
        rinfo.address + ":" + rinfo.port);
    });
    
    
    server.on("listening", function () {
      var address = server.address();
      console.log("server listening " +
          address.address + ":" + address.port);
    });
    
    
    server.bind(41234);
    Last edited by simoncpu; 10-10-2012 at 07:24 PM. Reason: added sample code

  4. #14

    Default Re: Listening to a UDP Socket using PHP...

    kana si simon maka tabang na nimo kai mao na iyang kina-on hehehe

  5. #15

    Default Re: Listening to a UDP Socket using PHP...

    while browsing my old hard drive i found some interesting projects regarding socket in php.... its not for site thou it is for some else... and its evil.... hahahahahahahaha... bitaw pang white hat siya....

  6. #16

    Default Re: Listening to a UDP Socket using PHP...

    ^ ahahahaha. Certified white hat. I salute you master.

    Quote Originally Posted by simoncpu View Post
    Bro, try daw ug node.js... Nindot siiya nga language for developing network apps... ECMAScript (JavaScript) iya gigamit, but you can write a web server (or a utility that sends UDP datagrams, in your case) in less than a dozen lines.

    Naay sample code sa documentation for creating a UDP server that listens to port 41234:

    Code:
    var dgram = require("dgram");
    
    
    var server = dgram.createSocket("udp4");
    
    
    server.on("message", function (msg, rinfo) {
      console.log("server got: " + msg + " from " +
        rinfo.address + ":" + rinfo.port);
    });
    
    
    server.on("listening", function () {
      var address = server.address();
      console.log("server listening " +
          address.address + ":" + address.port);
    });
    
    
    server.bind(41234);
    I will soon try this bro.
    Another learning na sad ni. The more the better. Thanks kaayo.
    If naa ko extra time I will definitely try this.


    Salamat kaayo sa inyo mga reply, tips and advices sa dri na thread mga masters.
    I really appreciate it.
    And sorry kaayo karun lang ko ka reply kay busy kaayo sa hardware.

    By the way finally maka listen/receive na jud ko ug UDP socket sa PHP.
    Here's the code:
    Code:
    <?php
    $sock = socket_create(AF_INET, SOCK_DGRAM, SOL_UDP);
    socket_bind($sock, "192.168.2.3", "6767") or die('Could not bind to address');
    
    while(1) {
        echo socket_read($sock,6767);
    }
    
    socket_close($sock);
    ?>
    192.168.2.3 > my ip address
    6767 > port to listen to

  7.    Advertisement

Page 2 of 2 FirstFirst 12

Similar Threads

 
  1. What are you listening to, right now?
    By dierdre in forum Humor
    Replies: 96816
    Last Post: 04-29-2022, 03:13 AM
  2. Replies: 1074
    Last Post: 04-07-2011, 01:02 PM
  3. how to connect database using php
    By skeptic_rob in forum Programming
    Replies: 15
    Last Post: 03-05-2011, 09:56 PM
  4. watch divx or listen to mp3 files in your ps2 using flashdisk
    By ongkal in forum Software & Games (Old)
    Replies: 6
    Last Post: 12-03-2008, 03:00 AM
  5. why do you listen to musik??
    By sab0y in forum Music & Radio
    Replies: 62
    Last Post: 09-15-2006, 01:34 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
about us
We are the first Cebu Online Media.

iSTORYA.NET is Cebu's Biggest, Southern Philippines' Most Active, and the Philippines' Strongest Online Community!
follow us
#top