March 15, 2013

php one line udp client

socket_sendto(socket_create(AF_INET, SOCK_DGRAM, SOL_UDP), $raw_post_data, strlen($raw_post_data), 0, '127.0.0.1', 57000);

The above will send the post data  (suppose it is in $raw_post_data) to a local udp server listening on port 57000.

No comments:

Post a Comment