Lines Matching refs:ts
83 tsd_t *ts = (tsd_t *)tsd;
89 ts->ts_lsns = (int *)malloc(lm_optB * sizeof (int));
90 if (ts->ts_lsns == NULL) {
93 ts->ts_accs = (int *)malloc(lm_optB * sizeof (int));
94 if (ts->ts_accs == NULL) {
97 ts->ts_cons = (int *)malloc(lm_optB * sizeof (int));
98 if (ts->ts_cons == NULL) {
101 ts->ts_adds = (struct sockaddr_in *)malloc(lm_optB *
103 if (ts->ts_adds == NULL) {
109 ts->ts_lsns[i] = socket(AF_INET, SOCK_STREAM, 0);
110 if (ts->ts_lsns[i] == -1) {
115 if (setsockopt(ts->ts_lsns[i], SOL_SOCKET, SO_REUSEADDR,
126 (void) memset(&ts->ts_adds[i], 0,
128 ts->ts_adds[i].sin_family = AF_INET;
129 ts->ts_adds[i].sin_port = htons(j++);
130 (void) memcpy(&ts->ts_adds[i].sin_addr.s_addr,
133 if (bind(ts->ts_lsns[i],
134 (struct sockaddr *)&ts->ts_adds[i],
145 if (listen(ts->ts_lsns[i], 5) == -1) {
157 tsd_t *ts = (tsd_t *)tsd;
165 ts->ts_cons[i] = socket(AF_INET, SOCK_STREAM, 0);
166 if (ts->ts_cons[i] == -1) {
172 if (fcntl(ts->ts_cons[i], F_SETFL, O_NDELAY) == -1) {
178 result = connect(ts->ts_cons[i],
179 (struct sockaddr *)&ts->ts_adds[i],
189 result = accept(ts->ts_lsns[i], (struct sockaddr *)&addr,
196 ts->ts_accs[i] = result;
205 tsd_t *ts = (tsd_t *)tsd;
209 if (close(ts->ts_accs[i]) == -1) {
221 tsd_t *ts = (tsd_t *)tsd;
225 (void) close(ts->ts_cons[i]);
234 tsd_t *ts = (tsd_t *)tsd;
238 (void) close(ts->ts_lsns[i]);