@@ -298,7 +298,7 @@ void Socket::Close()
298298 refCount_ = nullptr ;
299299}
300300
301- bool Socket::Bind (unsigned short port, bool useIPv6)
301+ bool Socket::Bind (unsigned short port, bool useIPv6) const
302302{
303303 union
304304 {
@@ -678,7 +678,7 @@ bool Socket::Connect(const std::string& hostname, const unsigned short port, boo
678678 *
679679 * @return -1 bei Fehler, Anzahl der empfangenen Bytes (max. @p length )
680680 */
681- int Socket::Recv (void * buffer, const int length, bool block)
681+ int Socket::Recv (void * buffer, const int length, bool block) const
682682{
683683 if (!isValid ())
684684 return -1 ;
@@ -687,7 +687,7 @@ int Socket::Recv(void* buffer, const int length, bool block)
687687 return recv (socket_, reinterpret_cast <char *>(buffer), length, (block ? 0 : MSG_PEEK));
688688}
689689
690- int Socket::Recv (void * const buffer, const int length, PeerAddr& addr)
690+ int Socket::Recv (void * const buffer, const int length, PeerAddr& addr) const
691691{
692692 if (!isValid ())
693693 return -1 ;
@@ -704,7 +704,7 @@ int Socket::Recv(void* const buffer, const int length, PeerAddr& addr)
704704 *
705705 * @return -1 bei Fehler, Anzahl der gesendeten Bytes (max. @p length )
706706 */
707- int Socket::Send (const void * const buffer, const int length)
707+ int Socket::Send (const void * const buffer, const int length) const
708708{
709709 if (!isValid ())
710710 return -1 ;
@@ -713,7 +713,7 @@ int Socket::Send(const void* const buffer, const int length)
713713 return send (socket_, reinterpret_cast <const char *>(buffer), length, 0 );
714714}
715715
716- int Socket::Send (const void * const buffer, const int length, const PeerAddr& addr)
716+ int Socket::Send (const void * const buffer, const int length, const PeerAddr& addr) const
717717{
718718 if (!isValid ())
719719 return -1 ;
@@ -729,7 +729,7 @@ int Socket::Send(const void* const buffer, const int length, const PeerAddr& add
729729 *
730730 * @return @p true bei Erfolg, @p false bei Fehler
731731 */
732- bool Socket::SetSockOpt (int nOptionName, const void * lpOptionValue, int nOptionLen, int nLevel)
732+ bool Socket::SetSockOpt (int nOptionName, const void * lpOptionValue, int nOptionLen, int nLevel) const
733733{
734734 return (SOCKET_ERROR != setsockopt (socket_, nLevel, nOptionName, (const char *)lpOptionValue, nOptionLen));
735735}
@@ -741,7 +741,7 @@ bool Socket::SetSockOpt(int nOptionName, const void* lpOptionValue, int nOptionL
741741 *
742742 * @return liefert true falls @p this größer ist als @p sock
743743 */
744- bool Socket::operator >(const Socket& sock)
744+ bool Socket::operator >(const Socket& sock) const
745745{
746746 return this ->socket_ > sock.socket_ ;
747747}
@@ -767,7 +767,7 @@ int Socket::BytesWaiting()
767767 *
768768 * @return liefert Null bei Erfolg, SOCKET_ERROR bei Fehler
769769 */
770- int Socket::BytesWaiting (unsigned * received)
770+ int Socket::BytesWaiting (unsigned * received) const
771771{
772772#ifdef _WIN32
773773 DWORD dwReceived;
@@ -784,7 +784,7 @@ int Socket::BytesWaiting(unsigned* received)
784784 *
785785 * @return liefert @p buffer zurück oder @p "" bei Fehler
786786 */
787- std::string Socket::GetPeerIP ()
787+ std::string Socket::GetPeerIP () const
788788{
789789 sockaddr_storage peer;
790790 socklen_t length = sizeof (sockaddr_storage);
@@ -802,7 +802,7 @@ std::string Socket::GetPeerIP()
802802 *
803803 * @return liefert @p buffer zurück oder @p "" bei Fehler
804804 */
805- std::string Socket::GetSockIP ()
805+ std::string Socket::GetSockIP () const
806806{
807807 sockaddr_storage peer;
808808 socklen_t length = sizeof (sockaddr_storage);
0 commit comments