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
c0fd19fd
Commit
c0fd19fd
authored
Aug 28, 2014
by
Ian Craggs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Retry change didn't work on Windows
Bug: 442400
parent
a4901bac
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
14 additions
and
12 deletions
+14
-12
MQTTAsync.c
src/MQTTAsync.c
+3
-3
MQTTClient.c
src/MQTTClient.c
+3
-3
MQTTProtocolClient.c
src/MQTTProtocolClient.c
+7
-5
MQTTProtocolClient.h
src/MQTTProtocolClient.h
+1
-1
No files found.
src/MQTTAsync.c
View file @
c0fd19fd
...
...
@@ -1435,7 +1435,7 @@ int MQTTAsync_completeConnection(MQTTAsyncs* m, MQTTPacket* pack)
Messages
*
m
=
(
Messages
*
)(
outcurrent
->
content
);
m
->
lastTouch
=
0
;
}
MQTTProtocol_retry
((
time_t
)
0
,
1
);
MQTTProtocol_retry
((
time_t
)
0
,
1
,
1
);
if
(
m
->
c
->
connected
!=
1
)
rc
=
MQTTASYNC_DISCONNECTED
;
}
...
...
@@ -2391,10 +2391,10 @@ void MQTTAsync_retry(void)
{
time
(
&
(
last
));
MQTTProtocol_keepalive
(
now
);
MQTTProtocol_retry
(
now
,
1
);
MQTTProtocol_retry
(
now
,
1
,
0
);
}
else
MQTTProtocol_retry
(
now
,
0
);
MQTTProtocol_retry
(
now
,
0
,
0
);
FUNC_EXIT
;
}
...
...
src/MQTTClient.c
View file @
c0fd19fd
...
...
@@ -903,7 +903,7 @@ int MQTTClient_connectURIVersion(MQTTClient handle, MQTTClient_connectOptions* o
Messages
*
m
=
(
Messages
*
)(
outcurrent
->
content
);
m
->
lastTouch
=
0
;
}
MQTTProtocol_retry
((
time_t
)
0
,
1
);
MQTTProtocol_retry
((
time_t
)
0
,
1
,
1
);
if
(
m
->
c
->
connected
!=
1
)
rc
=
MQTTCLIENT_DISCONNECTED
;
}
...
...
@@ -1518,10 +1518,10 @@ void MQTTClient_retry(void)
{
time
(
&
(
last
));
MQTTProtocol_keepalive
(
now
);
MQTTProtocol_retry
(
now
,
1
);
MQTTProtocol_retry
(
now
,
1
,
0
);
}
else
MQTTProtocol_retry
(
now
,
0
);
MQTTProtocol_retry
(
now
,
0
,
0
);
FUNC_EXIT
;
}
...
...
src/MQTTProtocolClient.c
View file @
c0fd19fd
...
...
@@ -549,14 +549,15 @@ void MQTTProtocol_keepalive(time_t now)
* MQTT retry processing per client
* @param now current time
* @param client - the client to which to apply the retry processing
* @param regardless boolean - retry packets regardless of retry interval (used on reconnect)
*/
void
MQTTProtocol_retries
(
time_t
now
,
Clients
*
client
)
void
MQTTProtocol_retries
(
time_t
now
,
Clients
*
client
,
int
regardless
)
{
ListElement
*
outcurrent
=
NULL
;
FUNC_ENTRY
;
if
(
now
>
(
time_t
)
0
&&
client
->
retryInterval
<=
0
)
/* 0 or -ive retryInterval turns off retry except on reconnect */
if
(
!
regardless
&&
client
->
retryInterval
<=
0
)
/* 0 or -ive retryInterval turns off retry except on reconnect */
goto
exit
;
while
(
client
&&
ListNextElement
(
client
->
outboundMsgs
,
&
outcurrent
)
&&
...
...
@@ -564,7 +565,7 @@ void MQTTProtocol_retries(time_t now, Clients* client)
Socket_noPendingWrites
(
client
->
net
.
socket
))
/* there aren't any previous packets still stacked up on the socket */
{
Messages
*
m
=
(
Messages
*
)(
outcurrent
->
content
);
if
(
difftime
(
now
,
m
->
lastTouch
)
>
max
(
client
->
retryInterval
,
10
))
if
(
regardless
||
difftime
(
now
,
m
->
lastTouch
)
>
max
(
client
->
retryInterval
,
10
))
{
if
(
m
->
qos
==
1
||
(
m
->
qos
==
2
&&
m
->
nextMessageType
==
PUBREC
))
{
...
...
@@ -618,8 +619,9 @@ exit:
* MQTT retry protocol and socket pending writes processing.
* @param now current time
* @param doRetry boolean - retries as well as pending writes?
* @param regardless boolean - retry packets regardless of retry interval (used on reconnect)
*/
void
MQTTProtocol_retry
(
time_t
now
,
int
doRetry
)
void
MQTTProtocol_retry
(
time_t
now
,
int
doRetry
,
int
regardless
)
{
ListElement
*
current
=
NULL
;
...
...
@@ -640,7 +642,7 @@ void MQTTProtocol_retry(time_t now, int doRetry)
if
(
Socket_noPendingWrites
(
client
->
net
.
socket
)
==
0
)
continue
;
if
(
doRetry
)
MQTTProtocol_retries
(
now
,
client
);
MQTTProtocol_retries
(
now
,
client
,
regardless
);
}
FUNC_EXIT
;
}
...
...
src/MQTTProtocolClient.h
View file @
c0fd19fd
...
...
@@ -43,7 +43,7 @@ int MQTTProtocol_handlePubrels(void* pack, int sock);
int
MQTTProtocol_handlePubcomps
(
void
*
pack
,
int
sock
);
void
MQTTProtocol_keepalive
(
time_t
);
void
MQTTProtocol_retry
(
time_t
,
int
);
void
MQTTProtocol_retry
(
time_t
,
int
,
int
);
void
MQTTProtocol_freeClient
(
Clients
*
client
);
void
MQTTProtocol_emptyMessageList
(
List
*
msgList
);
void
MQTTProtocol_freeMessageList
(
List
*
msgList
);
...
...
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