hi i am not clear with the socket connection in php,
because before starting a new topic i want to clear with the experts(you all guys),
why we use socket connection??

There is the php library for sockets which is used to give the user the ability to communicate over the socket protocol just like how the curl library gives users the ability to communicate over the curl protocol. It is widely used as an alternative to curl because it works more efficiently due to not being so dependent of apache there by lowering cpu and memory consumption. But when using sockets they can be hard to handle and the protocol can be hard to setup so that's why I prefer curl.

as far as my knowledge is concern you have to communicate with the assigned port number from 0 to 65535.
ftp 21
http 80 etc...etc...

There is the php library for sockets which is used to give the user the ability to communicate over the socket protocol just like how the curl library gives users the ability to communicate over the curl protocol. It is widely used as an alternative to curl because it works more efficiently due to not being so dependent of apache there by lowering cpu and memory consumption. But when using sockets they can be hard to handle and the protocol can be hard to setup so that's why I prefer curl.

Thanks a lot to clarify the socket connection and its alternative..