Jump to content

Search the Community

Showing results for tags 'socket'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • W3Schools
    • General
    • Suggestions
    • Critiques
  • HTML Forums
    • HTML/XHTML
    • CSS
  • Browser Scripting
    • JavaScript
    • VBScript
  • Server Scripting
    • Web Servers
    • Version Control
    • SQL
    • ASP
    • PHP
    • .NET
    • ColdFusion
    • Java/JSP/J2EE
    • CGI
  • XML Forums
    • XML
    • XSLT/XSL-FO
    • Schema
    • Web Services
  • Multimedia
    • Multimedia
    • FLASH

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests


Languages

Found 2 results

  1. I configured my Raspberry Pi as a LAMP server. I have LEDs connected to my RP and can control them with c/c++ programs. Now I want to built a web interface to control the colors of my LEDs. For my first attempt I used JQuery to send different commands to a PHP script that would execute a program with the color as a parameter. This doesn't seems to be the best solution, because I'm pretty limited on any effects I can make. So my second idea was to use sockets to send information to my program. This means my ledControler program listens for incoming commands and executes them. For this I used Websockets, but since I didn't use a library for my c++ program, it was very painfull to implement the whole WebSocket RFC. Another idea was to use PHP sockets. But I didn't test it out. My question is, am doing this completely wrong? Is there a simpler preferred way to do this?
  2. Mahdi

    socket programing

    in the name of Godhello guysI want to create a socket program using php, but at the first it has following error : socket_bind() [function_socket-bind]: Host lookup failed [0]: The requested name is valid, but no data of the requested type was found. in line 19. Could not bind to address. And my source is: <?php // Set time limit to indefinite execution set_time_limit (0); // Set the ip and port we will listen on $address = ' 192.168.0.1'; $port = 8080; // Create a TCP Stream socket $sock = socket_create(AF_INET, SOCK_STREAM, 0); // Bind the socket to an address/port socket_bind($sock, $address, $port) or die('Could not bind to address'); // Start listening for connections socket_listen($sock); /* Accept incoming requests and handle them as child processes */ $client = socket_accept($sock); // Read the input from the client – 1024 bytes $input = socket_read($client, 1024); // Strip all white spaces from input $output = ereg_replace("[ \t\n\r]","",$input).chr(0); // Display output back to client socket_write($client, $output); // Close the client (child) socket socket_close($client); // Close the master sockets socket_close($sock); ?> Above code is my server side program source Please tell me about the error. what does it mean?
×
×
  • Create New...