socket_create
Posted by: nana (---.tokem.fi)
Date: November 25, 2009 10:15AM

I have installed wampserver and I tried to run a code to create socketswith PHP. The code is:

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

And answer:

Fatal error: Call to undefined function socket_create()

How this should work?

Options: ReplyQuote
Re: socket_create
Posted by: stevenmartin99 (---.b-ras2.blp.dublin.eircom.net)
Date: November 25, 2009 10:33AM

u need to enable it

left click wamp>php>php extentions > tick php_sockets

Steven Martin
stevenmartin99@gmail.com
stevenmartin99@hotmail.com
PampServer.com - [pampserver.com]

Options: ReplyQuote
Re: socket_create
Posted by: nana (---.tokem.fi)
Date: November 25, 2009 11:03AM

Thank you. It worked when ignored some error messages that the service is not avaiblable.

Options: ReplyQuote
Re: socket_create
Posted by: nana (---.dhcp.inet.fi)
Date: November 30, 2009 10:42AM

Now my troubles continues with binding the sockets. Warning message is: "Warning: socket_bind() [function.socket-bind]: unable to bind address [0]:"

I'm trying to communicate with an embedded server that has a IP next to mine. How can find which ports I'm supposed to use?

Options: ReplyQuote
Re: socket_create
Posted by: stevenmartin99 (92.251.255.---)
Date: November 30, 2009 04:44PM

you need to find the sort the other server is running

Use netstart in cmd to find out. Also left click wamp cmd press put online so it can connect to the network

Steven Martin
stevenmartin99@gmail.com
stevenmartin99@hotmail.com
PampServer.com - [pampserver.com]

Options: ReplyQuote


Sorry, only registered users may post in this forum.