117117// / - Socket types
118118// / -# CActiveSocket Class
119119// / -# CPassiveSocket Class
120- class EXPORT CSimpleSocket {
120+ class CLSOCKET_API CSimpleSocket {
121121 friend class CPassiveSocket ;
122122public:
123123 // / Defines the three possible states for shuting down a socket.
@@ -207,11 +207,11 @@ class EXPORT CSimpleSocket {
207207
208208 inline bool CloseForReads () {
209209 return Shutdown ( CSimpleSocket::Receives );
210- };
210+ }
211211
212212 inline bool CloseForWrites () {
213213 return Shutdown ( CSimpleSocket::Sends );
214- };
214+ }
215215
216216 // / Examine the socket descriptor sets currently owned by the instance of
217217 // / the socket class (the readfds, writefds, and errorfds parameters) to
@@ -616,30 +616,22 @@ class EXPORT CSimpleSocket {
616616 // / Get the TCP receive buffer window size for the current socket object.
617617 // / <br><br>\b NOTE: Linux will set the receive buffer to twice the value passed.
618618 // / @return zero on failure else the number of bytes of the TCP receive buffer window size if successful.
619- uint32 GetReceiveWindowSize () {
620- return GetWindowSize (SO_RCVBUF);
621- };
619+ uint32 GetReceiveWindowSize ();
622620
623621 // / Get the TCP send buffer window size for the current socket object.
624622 // / <br><br>\b NOTE: Linux will set the send buffer to twice the value passed.
625623 // / @return zero on failure else the number of bytes of the TCP receive buffer window size if successful.
626- uint32 GetSendWindowSize () {
627- return GetWindowSize (SO_SNDBUF);
628- };
624+ uint32 GetSendWindowSize ();
629625
630626 // / Set the TCP receive buffer window size for the current socket object.
631627 // / <br><br>\b NOTE: Linux will set the receive buffer to twice the value passed.
632628 // / @return zero on failure else the number of bytes of the TCP send buffer window size if successful.
633- uint32 SetReceiveWindowSize (uint32 nWindowSize) {
634- return SetWindowSize (SO_RCVBUF, nWindowSize);
635- };
629+ uint32 SetReceiveWindowSize (uint32 nWindowSize);
636630
637631 // / Set the TCP send buffer window size for the current socket object.
638632 // / <br><br>\b NOTE: Linux will set the send buffer to twice the value passed.
639633 // / @return zero on failure else the number of bytes of the TCP send buffer window size if successful.
640- uint32 SetSendWindowSize (uint32 nWindowSize) {
641- return SetWindowSize (SO_SNDBUF, nWindowSize);
642- };
634+ uint32 SetSendWindowSize (uint32 nWindowSize);
643635
644636 // / Disable the Nagle algorithm (Set TCP_NODELAY to true)
645637 // / @return false if failed to set socket option otherwise return true;
@@ -672,11 +664,11 @@ class EXPORT CSimpleSocket {
672664private:
673665 // / Generic function used to get the send/receive window size
674666 // / @return zero on failure else the number of bytes of the TCP window size if successful.
675- uint32 GetWindowSize (uint32 nOptionName);
667+ CLSOCKET_NO_EXPORT uint32 GetWindowSize (uint32 nOptionName);
676668
677669 // / Generic function used to set the send/receive window size
678670 // / @return zero on failure else the number of bytes of the TCP window size if successful.
679- uint32 SetWindowSize (uint32 nOptionName, uint32 nWindowSize);
671+ CLSOCKET_NO_EXPORT uint32 SetWindowSize (uint32 nOptionName, uint32 nWindowSize);
680672
681673
682674 // / Attempts to send at most nNumItem blocks described by sendVector
@@ -688,29 +680,29 @@ class EXPORT CSimpleSocket {
688680 // / @return number of bytes actually sent, return of zero means the
689681 // / connection has been shutdown on the other side, and a return of -1
690682 // / means that an error has occurred.
691- int32 Writev (const struct iovec *pVector, size_t nCount);
683+ CLSOCKET_NO_EXPORT int32 Writev (const struct iovec *pVector, size_t nCount);
692684
693685 // / Flush the socket descriptor owned by the object.
694686 // / @return true data was successfully sent, else return false;
695- bool Flush ();
687+ CLSOCKET_NO_EXPORT bool Flush ();
696688
697- CSimpleSocket *operator =(CSimpleSocket &socket);
689+ CLSOCKET_NO_EXPORT CSimpleSocket *operator =(CSimpleSocket &socket);
698690
699691 static bool GetAddrInfoStatic (const char *pAddr, uint16 nPort, struct in_addr * pOutIpAddress, CSocketType nSocketType = SocketTypeTcp );
700692
701- bool GetAddrInfo (const char *pAddr, uint16 nPort, struct in_addr * pOutIpAddress );
693+ CLSOCKET_NO_EXPORT bool GetAddrInfo (const char *pAddr, uint16 nPort, struct in_addr * pOutIpAddress );
702694
703695 // / Utility function used to create a TCP connection, called from Open().
704696 // / @return true if successful connection made, otherwise false.
705- bool ConnectTCP (const char *pAddr, uint16 nPort);
697+ CLSOCKET_NO_EXPORT bool ConnectTCP (const char *pAddr, uint16 nPort);
706698
707699 // / Utility function used to create a UDP connection, called from Open().
708700 // / @return true if successful connection made, otherwise false.
709- bool ConnectUDP (const char *pAddr, uint16 nPort);
701+ CLSOCKET_NO_EXPORT bool ConnectUDP (const char *pAddr, uint16 nPort);
710702
711703 // / Utility function used to create a RAW connection, called from Open().
712704 // / @return true if successful connection made, otherwise false.
713- bool ConnectRAW (const char *pAddr, uint16 nPort);
705+ CLSOCKET_NO_EXPORT bool ConnectRAW (const char *pAddr, uint16 nPort);
714706
715707protected:
716708 SOCKET m_socket; // / socket handle
0 commit comments