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