repositories
/
deb_libcec.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
posix: fixed lib/platform/sockets/tcp.h compilation and some bugs. added CTcpSocket...
[deb_libcec.git]
/
src
/
lib
/
platform
/
sockets
/
socket.h
diff --git
a/src/lib/platform/sockets/socket.h
b/src/lib/platform/sockets/socket.h
index 530bd1be770d64a4ad617641b95fa805b9dbe55f..2e8acdbdca4de00fb7b76822b0ed36214c870d9f 100644
(file)
--- a/
src/lib/platform/sockets/socket.h
+++ b/
src/lib/platform/sockets/socket.h
@@
-48,7
+48,9
@@
namespace PLATFORM
{
public:
CSocket(void) :
{
public:
CSocket(void) :
- m_socket(INVALID_SOCKET) {};
+ m_socket(INVALID_SOCKET),
+ m_iError(0) {};
+
virtual ~CSocket(void)
{
Close();
virtual ~CSocket(void)
{
Close();
@@
-72,18
+74,16
@@
namespace PLATFORM
virtual int64_t Write(uint8_t* data, uint32_t len)
{
CLockObject lock(m_mutex);
virtual int64_t Write(uint8_t* data, uint32_t len)
{
CLockObject lock(m_mutex);
- int iError(0);
- int64_t iReturn = SocketWrite(m_socket, &iError, data, len);
- m_strError = strerror(iError);
+ int64_t iReturn = SocketWrite(m_socket, &m_iError, data, len);
+ m_strError = strerror(m_iError);
return iReturn;
}
virtual int32_t Read(uint8_t* data, uint32_t len, uint64_t iTimeoutMs = 0)
{
CLockObject lock(m_mutex);
return iReturn;
}
virtual int32_t Read(uint8_t* data, uint32_t len, uint64_t iTimeoutMs = 0)
{
CLockObject lock(m_mutex);
- int iError(0);
- int32_t iReturn = SocketRead(m_socket, &iError, data, len, iTimeoutMs);
- m_strError = strerror(iError);
+ int32_t iReturn = SocketRead(m_socket, &m_iError, data, len, iTimeoutMs);
+ m_strError = strerror(m_iError);
return iReturn;
}
return iReturn;
}
@@
-94,9
+94,15
@@
namespace PLATFORM
return strReturn;
}
return strReturn;
}
+ virtual int GetErrorNumber(void) const
+ {
+ return m_iError;
+ }
+
protected:
socket_t m_socket;
CStdString m_strError;
protected:
socket_t m_socket;
CStdString m_strError;
+ int m_iError;
CMutex m_mutex;
};
};
CMutex m_mutex;
};
};