My web hosting company is allowing only fsockopen function to create sockets. I am building an Android Application that needs a TCP Server for transferring message. So my question is it posible to build a TCP Server with fsockopen and not using socket_create?. Any help or suggestions greatly appreciated.
My web hosting company is allowing only fsockopen function to create sockets. I am
Share
fsockopen()creates client sockets only. There is no way to create a listening socket with that function.The only ways to create listening (server) TCP sockets in PHP are with the Streams extension (see
stream_socket_server()) – you may find that this is available as well – and the Sockets extension, which is less likely to be available.Even if you can create a listening socket you may find you are unable to do anything useful with it unless you have control over the server’s firewall, amongst other things.