close(c->sfd);
c->tcpsfd[c->cur_idx]= 0;
- if (atomic_add_32_nv((volatile uint32_t *)&ms_setting.servers[srv_idx].disconn_cnt, 1)
- % srv_conn_cnt == 0)
+ if (atomic_add_32_nv(&ms_setting.servers[srv_idx].disconn_cnt, 1)
+ % (uint32_t)srv_conn_cnt == 0)
{
gettimeofday(&ms_setting.servers[srv_idx].disconn_time, NULL);
fprintf(stderr, "Server %s:%d disconnect\n",
ms_setting.udp, &c->sfd) == 0)
{
c->tcpsfd[c->cur_idx]= c->sfd;
- if (atomic_add_32_nv((volatile uint32_t *)(&ms_setting.servers[srv_idx].reconn_cnt), 1)
- % srv_conn_cnt == 0)
+ if (atomic_add_32_nv(&ms_setting.servers[srv_idx].reconn_cnt, 1)
+ % (uint32_t)srv_conn_cnt == 0)
{
gettimeofday(&ms_setting.servers[srv_idx].reconn_time, NULL);
int reconn_time=
c->tcpsfd[i]= ret_sfd;
c->alive_sfds++;
- if (atomic_add_32_nv((volatile uint32_t *)(&ms_setting.servers[srv_idx].reconn_cnt), 1)
- % srv_conn_cnt == 0)
+ if (atomic_add_32_nv(&ms_setting.servers[srv_idx].reconn_cnt, 1)
+ % (uint32_t)srv_conn_cnt == 0)
{
gettimeofday(&ms_setting.servers[srv_idx].reconn_time, NULL);
int reconn_time=
int srv_port; /* server port */
/* for calculating how long the server disconnects */
- volatile int32_t disconn_cnt; /* number of disconnections count */
- volatile int32_t reconn_cnt; /* number of reconnections count */
+ volatile uint32_t disconn_cnt; /* number of disconnections count */
+ volatile uint32_t reconn_cnt; /* number of reconnections count */
struct timeval disconn_time; /* start time of disconnection */
struct timeval reconn_time; /* end time of reconnection */
} ms_mcd_server_t;