#ifndef SOCKET_H
#define SOCKET_H

/*
 * @(#)Socket.h
 *
 * This file is part of webCDwriter - Network CD Writing.
 *
 * Copyright (C) 2002-2004 Jörg P. M. Haeger
 *
 * webCDwriter is free software. See CDWserver.cpp for details.
 */

#include "Types.h"

class Socket {
	int fd;
	class BufferedReader *inputStream;
	class InputStream *inputStream2;
	String inetAddress;
public:
	Socket();
	Socket(int fd);
	Socket(const char *host, int port);
	~Socket();
	int getFD() { return fd; }
	String &getInetAddress();
	class BufferedReader &getInputStream();
	class InputStream &getInputStream2();
	int getOutputStream();
	int getPort();
	bool isConnected() { return fd >= 0; }
	void setKeepAlive(boolean on);
	void setSoLinger(boolean on, int linger);
	int write(const char *buf, int len);
};

#endif
