1 /* Copyright 2015-present Samsung Electronics Co., Ltd. and other contributors
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
7 * http://www.apache.org/licenses/LICENSE-2.0
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
17 #ifndef IOTJS_MODULE_UDP_H
18 #define IOTJS_MODULE_UDP_H
21 #include "iotjs_def.h"
22 #include "iotjs_handlewrap.h"
23 #include "iotjs_reqwrap.h"
27 iotjs_handlewrap_t handlewrap;
29 } IOTJS_VALIDATED_STRUCT(iotjs_udpwrap_t);
32 iotjs_udpwrap_t* iotjs_udpwrap_create(const iotjs_jval_t* judp);
34 iotjs_udpwrap_t* iotjs_udpwrap_from_handle(uv_udp_t* handle);
35 iotjs_udpwrap_t* iotjs_udpwrap_from_jobject(const iotjs_jval_t* judp);
37 uv_udp_t* iotjs_udpwrap_udp_handle(iotjs_udpwrap_t* udpwrap);
38 iotjs_jval_t* iotjs_udpwrap_jobject(iotjs_udpwrap_t* udpwrap);
42 iotjs_reqwrap_t reqwrap;
45 } IOTJS_VALIDATED_STRUCT(iotjs_send_reqwrap_t);
47 #define THIS iotjs_send_reqwrap_t* send_reqwrap
49 iotjs_send_reqwrap_t* iotjs_send_reqwrap_create(const iotjs_jval_t* jcallback,
50 const size_t msg_size);
52 void iotjs_send_reqwrap_dispatched(THIS);
54 uv_udp_send_t* iotjs_send_reqwrap_req(THIS);
55 const iotjs_jval_t* iotjs_send_reqwrap_jcallback(THIS);
60 #endif /* IOTJS_MODULE_UDP_H */