From: John L. <jr...@us...> - 2005-12-01 04:17:40
|
Update of /cvsroot/wxlua/wxLua/modules/wxluasocket/include In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32720/wxLua/modules/wxluasocket/include Modified Files: wxlsock.h Log Message: wxEVT_DEBUG_XXX -> wxEVT_WXLUA_DEBUG_XXX and export them for DLL reorder libs for linking in wxluaedit TRUE/FALSE -> true/false EVENT_DEBUG_XXX and CMD_XXX -> wxLUA_EVENT_DEBUG_XXX wxLUA_CMD_XXX Index: wxlsock.h =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxluasocket/include/wxlsock.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** wxlsock.h 25 Nov 2005 22:00:37 -0000 1.2 --- wxlsock.h 1 Dec 2005 04:17:29 -0000 1.3 *************** *** 54,62 **** { public: ! // constructor wxLuaAcceptedSocket(socket_type socket, sockaddr_in address); //wxLuaAcceptedSocket(const wxLuaAcceptedSocket &); ! wxLuaAcceptedSocket& operator=(const wxLuaAcceptedSocket &); private: --- 54,62 ---- { public: ! // Accepted socket constructor wxLuaAcceptedSocket(socket_type socket, sockaddr_in address); //wxLuaAcceptedSocket(const wxLuaAcceptedSocket &); ! //wxLuaAcceptedSocket& operator=(const wxLuaAcceptedSocket &); private: *************** *** 79,109 **** }; - // constructors wxLuaSocket(); wxLuaSocket(const wxLuaAcceptedSocket &acceptedSocket); // destructor ! ~wxLuaSocket(); ! // server: bind and listen for client connections void Listen(u_short port, int backLog = 100); ! ! // server: accept a connection from a client wxLuaAcceptedSocket Accept(); ! ! // client: connect a client to a server void Connect(const wxString &address, u_short port); - // Get the socket state ! SocketState GetState() const ! { ! return m_sockstate; ! } ! // Get the socket handle ! int GetSocket() const ! { ! return m_sock; ! } // Test if the socket is readable --- 79,102 ---- }; wxLuaSocket(); + // Socket constructor from an accepted socket wxLuaSocket(const wxLuaAcceptedSocket &acceptedSocket); // destructor ! virtual ~wxLuaSocket(); ! // Create a listening socket, using the specified port number ! // server: bind and listen for client connections void Listen(u_short port, int backLog = 100); ! // Accept a connection, returning an accepted socket. ! // server: accept a connection from a client wxLuaAcceptedSocket Accept(); ! // Connect to a given host and port number ! // client: connect a client to a server void Connect(const wxString &address, u_short port); // Get the socket state ! SocketState GetState() const { return m_sockstate; } // Get the socket handle ! int GetSocket() const { return m_sock; } // Test if the socket is readable *************** *** 125,138 **** // Get the port number of the socket int GetPort() const; - // Read the whole buffer of size length into buffer buffer from the socket int Read(char *buffer, int length); - // Write the whole buffer of size length to the socket void Write(const char *buffer, int length); ! ! // Shutdown the socket void Shutdown(int how); ! // Close the socket void Close(); --- 118,128 ---- // Get the port number of the socket int GetPort() const; // Read the whole buffer of size length into buffer buffer from the socket int Read(char *buffer, int length); // Write the whole buffer of size length to the socket void Write(const char *buffer, int length); ! // Shutdown the socket in an orderly fashion void Shutdown(int how); ! // Close the open socket void Close(); *************** *** 173,239 **** // constructors ! wxLuaSocketException(SocketErrorCode code) : m_code(code) ! { ! #ifdef WIN32 ! m_errnum = ::WSAGetLastError(); ! switch(m_errnum) ! { ! case WSANOTINITIALISED: ! m_description = _("A successful WSAStartup must occur before using this function."); ! break; ! ! case WSAENETDOWN: ! m_description = _("The network subsystem or the associated service provider has failed."); ! break; ! ! case WSAEAFNOSUPPORT: ! m_description = _("The specified address family is not supported."); ! break; ! ! case WSAEINPROGRESS: ! m_description = _("A blocking Windows Sockets 1.1 call is in progress, or the service provider is still processing a callback function."); ! break; ! ! case WSAEMFILE: ! m_description = _("No more socket descriptors are available."); ! break; ! ! case WSAENOBUFS: ! m_description = _("No buffer space is available. The socket cannot be created."); ! break; ! ! case WSAEPROTONOSUPPORT: ! m_description = _("The specified protocol is not supported."); ! break; ! ! case WSAEPROTOTYPE: ! m_description = _("The specified protocol is the wrong type for this socket."); ! break; ! ! case WSAESOCKTNOSUPPORT: ! m_description = _("The specified socket type is not supported in this address family."); ! break; ! } ! #else ! m_errnum = errno; ! #endif ! if (m_description.IsEmpty()) ! m_description = _("Socket Error"); ! } ! wxLuaSocketException(const wxLuaSocketException &e) ! : m_code(e.m_code), m_errnum(e.m_errnum) ! { ! } ! SocketErrorCode GetCode() const ! { ! return m_code; ! } ! int errnum() const ! { ! return m_errnum; ! } const wxString& description() { return m_description; } --- 163,173 ---- // constructors ! wxLuaSocketException(SocketErrorCode code); wxLuaSocketException(const wxLuaSocketException &e) ! : m_code(e.m_code), m_errnum(e.m_errnum) {} ! SocketErrorCode GetCode() const { return m_code; } ! int errnum() const { return m_errnum; } const wxString& description() { return m_description; } |