3 * Copyright (C) 2007-2008 Andreas Ă–man
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License
7 * as published by the Free Software Foundation; either version 2
8 * of the License, or (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
23 #include <sys/types.h>
28 typedef SOCKET socket_t;
33 socket_t htsp_tcp_connect(const char *hostname, int port, char *errbuf,
34 size_t errbufsize, int timeout);
36 int htsp_tcp_write_queue(socket_t fd, htsbuf_queue_t *q);
38 int htsp_tcp_read_line(socket_t fd, char *buf, const size_t bufsize,
39 htsbuf_queue_t *spill);
41 int htsp_tcp_read_data(socket_t fd, char *buf, const size_t bufsize,
42 htsbuf_queue_t *spill);
44 int htsp_tcp_read(socket_t fd, void *buf, size_t len);
46 int htsp_tcp_read_timeout(socket_t fd, void *buf, size_t len, int timeout);
48 void htsp_tcp_close(socket_t fd);