Lines Matching refs:psock
39 int psock; member
56 print_job->psock = open(printer_addr, O_CREAT | O_WRONLY | O_TRUNC, in _init()
59 if (print_job->psock == ERROR) { in _init()
66 print_job->psock = wConnect(printer_addr, print_job->port_num, _wprint_timeout_msec); in _init()
69 print_job->job_status = ((print_job->psock != -1) ? OK : ERROR); in _init()
99 bytes_written = write(print_job->psock, buffer, length); in _send_data()
114 FD_SET(print_job->psock, &w_fds); in _send_data()
117 selreturn = select(print_job->psock + 1, NULL, &w_fds, NULL, &timeout); in _send_data()
122 if (FD_ISSET(print_job->psock, &w_fds)) { in _send_data()
123 bytes_written = write(print_job->psock, buffer, length); in _send_data()
154 close(print_job->psock); in _end_job()
155 print_job->psock = -1; in _end_job()
181 int psock; in wConnect() local
183 psock = socket(PF_INET, SOCK_STREAM, 0); in wConnect()
184 if (psock == ERROR) return ERROR; in wConnect()
200 close(psock); in wConnect()
206 fcntl(psock, F_SETFL, O_NONBLOCK); in wConnect()
209 int socketConnect = connect(psock, (const struct sockaddr *) &sin, sizeof(sin)); in wConnect()
212 FD_SET(psock, &fdset); in wConnect()
220 if (select(psock + 1, NULL, &fdset, NULL, &tv) == 1) { in wConnect()
224 getsockopt(psock, SOL_SOCKET, SO_ERROR, &so_error, &len); in wConnect()
228 flags = fcntl(psock, F_GETFL); in wConnect()
229 fcntl(psock, F_SETFL, flags & ~O_NONBLOCK); in wConnect()
233 close(psock); in wConnect()
234 psock = ERROR; in wConnect()
240 close(psock); in wConnect()
241 psock = ERROR; in wConnect()
244 return psock; in wConnect()
257 print_job->psock = -1; in printer_connect()