This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

UDP to Ecler
#1
Hi Admin,

I have connection to a Ecler Matrix, the connection is there, but on UDP receive i get multiple answers but i have no cleu how to get them until the full response is ready, do you have a solution?

Code:
client:sendto("SYSTEM CONNECT\n\r", '192.168.1.246', 5800)
    result = client:receive()
    log(result)
    result = client:receive()
    log(result)
    result = client:receive()
    log(result)
    result = client:receive()
    log(result)
    result = client:receive()
    log(result)

Each receive gives me the next reponse line, but i want them all until it's done with one receive call...
Reply
#2
Each receive() call returns a single UDP message. You should call receive in a loop until the ending message is received. If that's not possible then set socket timeout to detect when no messages are left to receive.
Reply
#3
Already done that but i thought that was not “clean”, thanks for confirming this is the way to go..
Reply


Forum Jump: