HIMSISFO

Would you like to react to this message? Create an account in a few clicks or log in to continue.
HIMSISFO

Himpunan Mahasiswa Sistem Informasi Universitas Mercubuana


3 posters

    Send Packet In PHP

    avatar
    t-3-r-m-i-n-4-t-0-r
    Mahasiswa pendatang
    Mahasiswa pendatang


    Jumlah posting : 2
    Fakultas : Yash
    Jurusan : ---
    Interest in : Mig33, Hacking
    Registration date : 06.09.09

    Send Packet In PHP Empty Send Packet In PHP

    Post by t-3-r-m-i-n-4-t-0-r Thu Sep 10, 2009 7:35 am

    Its a topic to share your ideas regarding to sending PACKETS by the use of SOCKET in PHP...

    Let's start with a simple example - a TCP server that accepts a string as input, reverses it and returns it to the client. Here's the code:
    Code:
    <?

    // set some variables
    $host = "192.168.1.99";
    $port = 1234;

    // don't timeout!
    set_time_limit(0);

    // create socket
    $socket = socket_create(AF_INET, SOCK_STREAM, 0) or die("Could not create
    socket\n");

    // bind socket to port
    $result = socket_bind($socket, $host, $port) or die("Could not bind to
    socket\n");

    // start listening for connections
    $result = socket_listen($socket, 3) or die("Could not set up socket
    listener\n");

    // accept incoming connections
    // spawn another socket to handle communication
    $spawn = socket_accept($socket) or die("Could not accept incoming
    connection\n");

    // read client input
    $input = socket_read($spawn, 1024) or die("Could not read input\n");

    // clean up input string
    $input = trim($input);

    // reverse client input and send back
    $output = strrev($input) . "\n";
    socket_write($spawn, $output, strlen ($output)) or die("Could not write
    output\n");

    // close sockets
    socket_close($spawn);
    socket_close($socket);
    ?>


    HOW CAN WE SEND MIG33 LOGIN PACKETS BY SOCKETS IN PHP?? gaya
    Alen1.1
    Alen1.1
    Super Administrator
    Super Administrator


    Male Jumlah posting : 82
    Age : 33
    Fakultas : Fasilkom
    Jurusan : sistem informasi
    Interest in : Visual Basic,xna,C#
    Registration date : 07.01.09

    Send Packet In PHP Empty Re: Send Packet In PHP

    Post by Alen1.1 Thu Sep 10, 2009 7:49 am

    Thank you very much bro...

    I would like to learn more about php...
    So that article is very useful for me gaya
    chepyjakarta
    chepyjakarta
    Mahasiswa pendatang
    Mahasiswa pendatang


    Male Jumlah posting : 9
    Age : 34
    Fakultas : Komputer
    Jurusan : sistem Informasi
    Interest in : 2008
    Registration date : 15.07.10

    Send Packet In PHP Empty Re: Send Packet In PHP

    Post by chepyjakarta Thu Jul 15, 2010 11:37 am

    len, gw mo nanya tentang bahasa pemrograman PHP / My SQL ????
    bls

    Sponsored content


    Send Packet In PHP Empty Re: Send Packet In PHP

    Post by Sponsored content


      Waktu sekarang Fri Apr 26, 2024 8:21 pm