Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add UDP.recv and udp_recv #507

Open
postmodern opened this issue May 5, 2024 · 0 comments
Open

Add UDP.recv and udp_recv #507

postmodern opened this issue May 5, 2024 · 0 comments
Labels
feature New Feature mixin Mixin network Network udp UDP

Comments

@postmodern
Copy link
Member

To compliment UDP.send and udp_send, there should be UDP.recv and UDP::Mixin#udp_recv methods. These methods should call connect with the host and port arguments, then calls .recv(1024) to read the first chunk of data sent through the connection. This method is similar to UDP.banner and udp_banner, but it reads the whole packet of data and doesn't stop at the first newline.

data = UDP.recv(host,port)
data = UDP.recv(host,port, length: 4096)
include Network::UDP::Mixin

data = udp_recv(host,port)
data = udp_recv(host,port, length: 4096)
@postmodern postmodern added network Network udp UDP feature New Feature mixin Mixin labels May 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New Feature mixin Mixin network Network udp UDP
Projects
None yet
Development

No branches or pull requests

1 participant