Lines Matching refs:sock
108 sock_connect(int sock, char *host, int timeout)
164 if (connect(sock, (struct sockaddr *)&sin, sizeof (sin)) < 0) {
179 return (sock);
411 send_data_file(int sock, char *dfname, char *name)
430 if (send_lpd_message(sock, "\003%d %s\n", st.st_size, dfname) < 0)
435 if (sendfile(sock, fd, &off, st.st_size) != st.st_size)
441 if (send_lpd_message(sock, "") < 0)
449 send_control_file(int sock, char *data, int id)
479 if (send_lpd_message(sock, "\002%d cfA%.3d%s\n", len, id, host) < 0)
483 if (write(sock, data, len) != len)
488 if (send_lpd_message(sock, "") < 0)
496 submit_job(int sock, char *printer, int job_id, char *path)
511 sock, printer, job_id, path);
518 sock, printer, job_id, path);
526 sock, printer, job_id, path);
534 sock, printer, job_id, path);
552 if (send_lpd_message(sock, "\002%s\n", printer) < 0) {
559 if (send_control_file(sock, metadata, job_id) < 0) {
561 write(sock, "\001\n", 2); /* abort */
581 if (send_data_file(sock, ptr, name) < 0) {
583 write(sock, "\001\n", 2); /* abort */
602 close(sock);