|
|
@ -636,17 +636,21 @@ IsoClientConnection_handleConnection(IsoClientConnection self)
|
|
|
|
bool
|
|
|
|
bool
|
|
|
|
IsoClientConnection_associateAsync(IsoClientConnection self, uint32_t connectTimeoutInMs)
|
|
|
|
IsoClientConnection_associateAsync(IsoClientConnection self, uint32_t connectTimeoutInMs)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
Semaphore_wait(self->tickMutex);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* Create socket and start connect */
|
|
|
|
|
|
|
|
|
|
|
|
self->socket = TcpSocket_create();
|
|
|
|
self->socket = TcpSocket_create();
|
|
|
|
|
|
|
|
|
|
|
|
if (self->socket == NULL)
|
|
|
|
if (self->socket == NULL) {
|
|
|
|
|
|
|
|
Semaphore_post(self->tickMutex);
|
|
|
|
return false;
|
|
|
|
return false;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
bool success = true;
|
|
|
|
bool success = true;
|
|
|
|
|
|
|
|
|
|
|
|
/* Create socket and start connect */
|
|
|
|
|
|
|
|
setState(self, STATE_CONNECTING);
|
|
|
|
setState(self, STATE_CONNECTING);
|
|
|
|
|
|
|
|
setIntState(self, INT_STATE_TCP_CONNECTING);
|
|
|
|
Semaphore_wait(self->tickMutex);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#if (CONFIG_ACTIVATE_TCP_KEEPALIVE == 1)
|
|
|
|
#if (CONFIG_ACTIVATE_TCP_KEEPALIVE == 1)
|
|
|
|
Socket_activateTcpKeepAlive(self->socket,
|
|
|
|
Socket_activateTcpKeepAlive(self->socket,
|
|
|
@ -655,8 +659,6 @@ IsoClientConnection_associateAsync(IsoClientConnection self, uint32_t connectTim
|
|
|
|
CONFIG_TCP_KEEPALIVE_CNT);
|
|
|
|
CONFIG_TCP_KEEPALIVE_CNT);
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
setIntState(self, INT_STATE_TCP_CONNECTING);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* set timeout for connect */
|
|
|
|
/* set timeout for connect */
|
|
|
|
self->nextReadTimeout = Hal_getTimeInMs() + connectTimeoutInMs;
|
|
|
|
self->nextReadTimeout = Hal_getTimeInMs() + connectTimeoutInMs;
|
|
|
|
|
|
|
|
|
|
|
|