SOCKET connect C/C++ to PHP

Discussion in 'C++' started by gilit2, Sep 6, 2012.

  1. gilit2

    gilit2 New Member

    Joined:
    Sep 6, 2012
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    0
    Hi
    I need to send messages from php to C/C++
    Can anyone show me the code of
    server in C , windows
    and
    client in PHP
    using socket
    I have managed to do socket from php to php
    (both server and client in php)
    I need only the simple option for one connection
    So I need only the most basic
     
  2. shabbir

    shabbir Administrator Staff Member

    Joined:
    Jul 12, 2004
    Messages:
    15,376
    Likes Received:
    388
    Trophy Points:
    83
    Having same thread in different forums does not help and so deleted your other thread.
     
  3. Becks

    Becks New Member

    Joined:
    Feb 23, 2013
    Messages:
    2
    Likes Received:
    1
    Trophy Points:
    0
    I would be interested in the some tipps about sockets etc.
     
  4. Syperus

    Syperus New Member

    Joined:
    Sep 2, 2011
    Messages:
    45
    Likes Received:
    9
    Trophy Points:
    0
    Location:
    127.0.0.1
    @Becks, If you want to do some C++ programming with sockets you will need to learn TCP/UDP socket protocols and how to handle them. You'll first need to decide whether these sockets will be TCP or UDP sockets ie Do you need to establish a connection with the server, or do you need to ensure the information is received in the order it was sent, or do you need error handling? If any of these then you will need a TCP socket, otherwise you can use UDP. With UDP information is sent to the destination without establishing a connection to the server, no error handling, and since there is no error handling there is guarantee the information you sent was received by the server or that all your information was received in the correct order. UDP is useful for sending updates to a server ie A control panel. Just remember those 3 options about TCP. If any of those, then you need to use a TCP socket (which does require more properties) otherwise you might be able to get by with a UDP. Learning TCP/IP networking can help a lot in this category. You will understand how sockets work better, and what needs to happen for them to be handled properly.
     
    Last edited: Apr 7, 2013
    shabbir and Becks like this.

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice