Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
P
paho.mqtt.c
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
eclipse
paho.mqtt.c
Commits
80dcde41
Commit
80dcde41
authored
Apr 10, 2017
by
Ian Craggs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Set client object for connlost callback in MQTTAsync_subscribe sample #176
parent
7f0e3a26
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
3 deletions
+4
-3
MQTTAsync_subscribe.c
src/samples/MQTTAsync_subscribe.c
+4
-3
No files found.
src/samples/MQTTAsync_subscribe.c
View file @
80dcde41
...
...
@@ -45,7 +45,8 @@ void connlost(void *context, char *cause)
int
rc
;
printf
(
"
\n
Connection lost
\n
"
);
printf
(
" cause: %s
\n
"
,
cause
);
if
(
cause
)
printf
(
" cause: %s
\n
"
,
cause
);
printf
(
"Reconnecting
\n
"
);
conn_opts
.
keepAliveInterval
=
20
;
...
...
@@ -53,7 +54,7 @@ void connlost(void *context, char *cause)
if
((
rc
=
MQTTAsync_connect
(
client
,
&
conn_opts
))
!=
MQTTASYNC_SUCCESS
)
{
printf
(
"Failed to start connect, return code %d
\n
"
,
rc
);
finished
=
1
;
finished
=
1
;
}
}
...
...
@@ -143,7 +144,7 @@ int main(int argc, char* argv[])
MQTTAsync_create
(
&
client
,
ADDRESS
,
CLIENTID
,
MQTTCLIENT_PERSISTENCE_NONE
,
NULL
);
MQTTAsync_setCallbacks
(
client
,
NULL
,
connlost
,
msgarrvd
,
NULL
);
MQTTAsync_setCallbacks
(
client
,
client
,
connlost
,
msgarrvd
,
NULL
);
conn_opts
.
keepAliveInterval
=
20
;
conn_opts
.
cleansession
=
1
;
...
...
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