Lines Matching refs:ts
112 tsd_t *ts = (tsd_t *)tsd;
117 ts->ts_lsns = (int *)malloc(lm_optB * sizeof (int));
118 if (ts->ts_lsns == NULL) {
121 ts->ts_accs = (int *)malloc(lm_optB * sizeof (int));
122 if (ts->ts_accs == NULL) {
125 ts->ts_cons = (int *)malloc(lm_optB * sizeof (int));
126 if (ts->ts_cons == NULL) {
129 ts->ts_adds =
132 if (ts->ts_accs == NULL) {
138 ts->ts_lsns[i] = socket(AF_INET, SOCK_STREAM, 0);
139 if (ts->ts_lsns[i] == -1) {
149 if (fcntl(ts->ts_lsns[i], F_SETFL, O_NDELAY) == -1) {
160 (void) memset(&ts->ts_adds[i], 0,
162 ts->ts_adds[i].sin_family = AF_INET;
163 ts->ts_adds[i].sin_port = htons(j++);
164 (void) memcpy(&ts->ts_adds[i].sin_addr.s_addr,
167 if (bind(ts->ts_lsns[i],
168 (struct sockaddr *)&ts->ts_adds[i],
178 if (listen(ts->ts_lsns[i], 5) == -1) {
189 tsd_t *ts = (tsd_t *)tsd;
194 if (ts->ts_once++ == 0) {
202 ts->ts_cons[i] = socket(AF_INET, SOCK_STREAM, 0);
203 if (ts->ts_cons[i] == -1) {
208 if (fcntl(ts->ts_cons[i], F_SETFL, O_NDELAY) == -1) {
214 result = connect(ts->ts_cons[i],
215 (struct sockaddr *)&ts->ts_adds[i],
233 tsd_t *ts = (tsd_t *)tsd;
242 result = connect(ts->ts_cons[i],
243 (struct sockaddr *)&ts->ts_adds[i],
250 pollfd.fd = ts->ts_cons[i];
266 result = accept(ts->ts_lsns[i],
271 pollfd.fd = ts->ts_lsns[i];
277 ts->ts_accs[i] = result;
293 tsd_t *ts = (tsd_t *)tsd;
299 (void) close(ts->ts_accs[i]);
301 (void) close(ts->ts_cons[i]);