SOCKET connect C/C++ to PHP

gilit2's Avatar, Join Date: Sep 2012
Newbie Member
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
shabbir's Avatar, Join Date: Jul 2004
Go4Expert Founder
Having same thread in different forums does not help and so deleted your other thread.
Becks's Avatar, Join Date: Feb 2013
Newbie Member
I would be interested in the some tipps about sockets etc.
Syperus's Avatar, Join Date: Sep 2011
Go4Expert Member
@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 by Syperus; 7Apr2013 at 18:33..
Becks, shabbir likes this