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

Already on GitHub? Sign in to your account

UDP Support #205

Closed
wants to merge 1 commit into
from

Conversation

Projects
None yet
2 participants
Contributor

Sh4rK commented Apr 20, 2012

UDP Support + a few tests

There is a problem I know of, but it doesn't really affect correct usage, so I think this can be pulled, and fixed later. The problem is that sending datagrams larger than 65535 bytes should be an error, but it isn't currently.

Contributor

philips commented Apr 23, 2012

I pushed a branch that adds the stuff to the global symbols and gyp build system: https://github.com/luvit/luvit/tree/dgram

However, I am hitting a SIGBUS: https://gist.github.com/7836458dfb6ddbda2043

Contributor

Sh4rK commented Apr 23, 2012

Can you check if luv_new_udp is called before luv_udp_recv_start? It should initialize the handles.

I don't know what causes this, as it runs fine here (I tested release build on Windows, x86), and all the tests pass.

Contributor

Sh4rK commented May 21, 2012

Can anyone tell me what to do with this to be pulled?

Contributor

philips commented May 21, 2012

https://github.com/philips/luvit/tree/build-dgram gets everything to build but where is uv_udp_t defined?

@philips philips commented on the diff May 21, 2012

src/luv_udp.c
return 0;
}
int luv_udp_recv_stop(lua_State* L) {
uv_udp_t* handle = (uv_udp_t*)luv_checkudata(L, 1, "udp");
- uv_udp_recv_stop(handle);
+ if (uv_udp_recv_stop(handle)) {
+ uv_err_t err = uv_last_error(luv_get_loop(L));
+ return luaL_error(L, "udp_recv_stop: %s", uv_strerror(err));
+ }
+ luv_handle_unref(L, handle->data);
@philips

philips May 21, 2012

Contributor

You never create the initial ref anywhere but you ref and unref it.

Contributor

Sh4rK commented May 22, 2012

Yeah, I don't fully get it how that thing works, so I would appreciate some help, if you know what to do. Where should I create the initial ref? Doen't luv_new_udp do that?

@philips philips referenced this pull request May 22, 2012

Closed

Implement the rest of UDP #13

Contributor

philips commented Aug 8, 2012

Closing this out. UDP support based on @Sh4rK merged earlier today by @rphillips.

@philips philips closed this Aug 8, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment