Go to the documentation of this file.
21 #ifndef GNASH_SOCKET_H
22 #define GNASH_SOCKET_H
59 bool connect(
const std::string& hostname, std::uint16_t port);
72 bool connected()
const;
79 virtual bool bad()
const {
85 virtual std::streamsize read(
void* dst, std::streamsize num);
88 virtual std::streamsize readNonBlocking(
void* dst, std::streamsize num);
96 virtual std::streamsize
write(
const void* src, std::streamsize num);
101 virtual std::streampos tell()
const;
106 virtual bool seek(std::streampos
p);
111 virtual void go_to_end();
118 virtual bool eof()
const;
125 mutable bool _connected;
144 #endif // GNASH_IOCHANNEL_H
static LogFile & getDefaultInstance()
Definition: log.cpp:77
virtual std::streamsize readNonBlocking(void *dst, std::streamsize num)
Read up to the given number of bytes from the Socket.
Definition: Socket.cpp:317
virtual std::streampos tell() const
Return current stream position.
Definition: Socket.cpp:395
size_t arraySize(T(&)[N])
Get the size of an array without passing a pointer by mistake.
Definition: GnashAlgorithm.h:58
void log_debug(StringType msg, Args... args)
Definition: log.h:301
#define _(String)
Definition: log.h:44
Anonymous namespace for callbacks, local functions, event handlers etc.
Definition: dbus_ext.cpp:41
virtual bool eof() const
Return true if the end of the stream has been reached.
Definition: Socket.cpp:415
@ start
Definition: klash_part.cpp:330
virtual ~Socket()
Definition: Socket.h:48
bool connected() const
Whether a connection attempt is complete.
Definition: Socket.cpp:50
virtual void go_to_end()
Seek to the end of the stream.
Definition: Socket.cpp:409
void log_error(StringType msg, Args... args)
Definition: log.h:283
virtual bool seek(std::streampos p)
Seek to the specified position.
Definition: Socket.cpp:402
A virtual IO channel.
Definition: IOChannel.h:43
void write(SimpleBuffer &buf, const std::string &str)
Write a string to an AMF buffer.
Definition: AMF.cpp:161
code
Definition: GnashKey.h:44
A simple IOChannel subclass for reading and writing sockets.
Definition: Socket.h:42
@ p
Definition: GnashKey.h:162
virtual std::streamsize read(void *dst, std::streamsize num)
Read exactly the given number of bytes from the Socket or none at all.
Definition: Socket.cpp:302
virtual std::streamsize write(const void *src, std::streamsize num)
Write the given number of bytes to the stream.
Definition: Socket.cpp:355
void close()
Close the Socket.
Definition: Socket.cpp:114
#define DSOEXPORT
Definition: dsodefs.h:55
bool connect(const std::string &hostname, std::uint16_t port)
Initiate a connection.
Definition: Socket.cpp:147
Socket()
Create a non-connected socket.
Definition: Socket.cpp:40
virtual bool bad() const
True if the Socket is in an error condition.
Definition: Socket.h:79