) {
memcpy(&(newdata->bind), &(data->bind), sizeof(data->bind));
newdata->connected = 1;
- JS_SetOpaque(new, newdata);
+ newdata->type = data->type;
(void) sock_set_timeout(newdata, data->timeout);
+ JS_SetOpaque(new, newdata);
return new;
} else {
// Read Argument either as ArrayBuffer or String
if ( (buf = JS_GetArrayBuffer(ctx, &len, argv[0])) ) {
- len = sendto(data->fd, buf, len, flags, to, to ? sizeof(*to) : 0);
-
+ len = sendto(data->fd, buf, len, flags, to,
+ to ? sizeof(struct sockaddr_storage) : 0
+ );
} else if ( (buf = (uint8_t*) JS_ToCStringLen(ctx, &len, argv[0])) ) {
- len = sendto(data->fd, buf, len, flags, to, to ? sizeof(*to) : 0);
+ len = sendto(data->fd, buf, len, flags, to,
+ to ? sizeof(struct sockaddr_storage) : 0
+ );
JS_FreeCString(ctx, (char *) buf);
} else return JS_ThrowTypeError(ctx,
&& !sock_set_timeout(so, net_timeout)
&& !connect(so->fd,(struct sockaddr *) addr ,sizeof(*addr))
) {
+ so->bind.ss_family = AF_UNIX;
so->connected = 1;
return 0;
} else if (!con