Socket and pack issues.

Source: Internet
Author: User
$message = "; $message. = Pack (" A99 ", $mail); $message. = Pack (" A32 ", $pass); $message. = Pack (" A19 ", $action); $from ="; $p ORT = 0;//echo $message, if ($socket = Socket_create (Af_inet, Sock_dgram, sol_udp)) {//socket_bind ($socket, ' 127.0.0.1 ', 27015) socket_sendto ($socket, $message, strlen ($message), 0, $server _ip, $server _port); $ret = Socket_recvfrom ($socket , $result, Msg_waitall, $from, $port);}


Using this code to send a UDP struct is unsuccessful, and the pack is commented out and executed again, no problem.
Socket_sendto not sent successfully, the other party received no message, no return data. has been blocked--
How does UDP send a struct?


Reply to discussion (solution)

No one answered???

No complete code, no receiving end
Who knows what you're going to do?

Don't blame others for ignoring you, guess there is no condition

Oh hehe oh oh.
It is a simple test program, but also need to put the complete code?
That's very clear. No one answers, just forget it.

So, I'm going to do a receiver to listen to ROM.
I want to say no problem, do you believe it?

  • Related Article

    Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.