Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
K
k-sdk
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
陈伟灿
k-sdk
Commits
92ffcb69
Commit
92ffcb69
authored
Sep 24, 2020
by
黄振令
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
【修改内容】openwrt上发广播失败:设置多个socket属性失败,分开设置就成功
parent
54c2eb47
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
1 deletion
+10
-1
platform/zigbee/app/builder/Z3GatewayHost/rpc_api/src/rpc_interface_parse.c
...p/builder/Z3GatewayHost/rpc_api/src/rpc_interface_parse.c
+10
-1
No files found.
platform/zigbee/app/builder/Z3GatewayHost/rpc_api/src/rpc_interface_parse.c
View file @
92ffcb69
...
@@ -331,7 +331,7 @@ int search_ccu(char devcode[33], char ip[16], int* port){
...
@@ -331,7 +331,7 @@ int search_ccu(char devcode[33], char ip[16], int* port){
return
-
1
;
return
-
1
;
}
}
if
(
setsockopt
(
sock
,
SOL_SOCKET
,
SO_BROADCAST
|
SO_REUSEADDR
,
&
iOptval
,
sizeof
(
int
))
<
0
)
if
(
setsockopt
(
sock
,
SOL_SOCKET
,
SO_BROADCAST
,
&
iOptval
,
sizeof
(
int
))
<
0
)
{
{
printf
(
"[%s] setsockopt failed
\n
"
,
__FUNCTION__
);
printf
(
"[%s] setsockopt failed
\n
"
,
__FUNCTION__
);
close
(
sock
);
close
(
sock
);
...
@@ -339,6 +339,15 @@ int search_ccu(char devcode[33], char ip[16], int* port){
...
@@ -339,6 +339,15 @@ int search_ccu(char devcode[33], char ip[16], int* port){
return
-
1
;
return
-
1
;
}
}
if
(
setsockopt
(
sock
,
SOL_SOCKET
,
SO_REUSEADDR
,
&
iOptval
,
sizeof
(
int
))
<
0
)
{
printf
(
"[%s] setsockopt failed
\n
"
,
__FUNCTION__
);
close
(
sock
);
close
(
sk_recv
);
return
-
1
;
}
if
(
setsockopt
(
sk_recv
,
SOL_SOCKET
,
SO_REUSEADDR
,
&
iOptval
,
sizeof
(
int
))
<
0
)
if
(
setsockopt
(
sk_recv
,
SOL_SOCKET
,
SO_REUSEADDR
,
&
iOptval
,
sizeof
(
int
))
<
0
)
{
{
printf
(
"[%s] setsockopt failed
\n
"
,
__FUNCTION__
);
printf
(
"[%s] setsockopt failed
\n
"
,
__FUNCTION__
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment