git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@57546
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
virtual wxSocketImpl *WaitConnection(wxSocketBase& wxsocket);
virtual wxSocketImpl *WaitConnection(wxSocketBase& wxsocket);
- int Read(char *buffer, int size);
- int Write(const char *buffer, int size);
+ int Read(void *buffer, int size);
+ int Write(const void *buffer, int size);
private:
virtual wxSocketError DoHandleConnect(int ret);
private:
virtual wxSocketError DoHandleConnect(int ret);
wxSocketError Input_Timeout();
wxSocketError Output_Timeout();
wxSocketError Connect_Timeout();
wxSocketError Input_Timeout();
wxSocketError Output_Timeout();
wxSocketError Connect_Timeout();
- int Recv_Stream(char *buffer, int size);
- int Recv_Dgram(char *buffer, int size);
- int Send_Stream(const char *buffer, int size);
- int Send_Dgram(const char *buffer, int size);
+ int Recv_Stream(void *buffer, int size);
+ int Recv_Dgram(void *buffer, int size);
+ int Send_Stream(const void *buffer, int size);
+ int Send_Dgram(const void *buffer, int size);
// IO operations
// -------------
// IO operations
// -------------
- virtual int Read(char *buffer, int size) = 0;
- virtual int Write(const char *buffer, int size) = 0;
+ virtual int Read(void *buffer, int size) = 0;
+ virtual int Write(const void *buffer, int size) = 0;
wxSocketEventFlags Select(wxSocketEventFlags flags);
wxSocketEventFlags Select(wxSocketEventFlags flags);
virtual void Shutdown();
virtual wxSocketImpl *WaitConnection(wxSocketBase& wxsocket);
virtual void Shutdown();
virtual wxSocketImpl *WaitConnection(wxSocketBase& wxsocket);
- int Read(char *buffer, int size);
- int Write(const char *buffer, int size);
+ int Read(void *buffer, int size);
+ int Write(const void *buffer, int size);
//attach or detach from main loop
void Notify(bool flag);
//attach or detach from main loop
void Notify(bool flag);
wxSocketError Input_Timeout();
wxSocketError Output_Timeout();
wxSocketError Input_Timeout();
wxSocketError Output_Timeout();
- int Recv_Stream(char *buffer, int size);
- int Recv_Dgram(char *buffer, int size);
- int Send_Stream(const char *buffer, int size);
- int Send_Dgram(const char *buffer, int size);
+ int Recv_Stream(void *buffer, int size);
+ int Recv_Dgram(void *buffer, int size);
+ int Send_Stream(const void *buffer, int size);
+ int Send_Dgram(const void *buffer, int size);
/* Generic IO */
/* Like recv(), send(), ... */
/* Generic IO */
/* Like recv(), send(), ... */
-int wxSocketImplMSW::Read(char *buffer, int size)
+int wxSocketImplMSW::Read(void *buffer, int size)
-int wxSocketImplMSW::Write(const char *buffer, int size)
+int wxSocketImplMSW::Write(const void *buffer, int size)
return wxSOCKET_NOERROR;
}
return wxSOCKET_NOERROR;
}
-int wxSocketImplMSW::Recv_Stream(char *buffer, int size)
+int wxSocketImplMSW::Recv_Stream(void *buffer, int size)
- return recv(m_fd, buffer, size, 0);
+ return recv(m_fd, static_cast<char *>(buffer), size, 0);
-int wxSocketImplMSW::Recv_Dgram(char *buffer, int size)
+int wxSocketImplMSW::Recv_Dgram(void *buffer, int size)
{
wxSockAddr from;
WX_SOCKLEN_T fromlen = sizeof(from);
int ret;
wxSocketError err;
{
wxSockAddr from;
WX_SOCKLEN_T fromlen = sizeof(from);
int ret;
wxSocketError err;
- ret = recvfrom(m_fd, buffer, size, 0, (sockaddr*)&from, &fromlen);
+ ret = recvfrom(m_fd, static_cast<char *>(buffer),
+ size, 0, &from, &fromlen);
if (ret == SOCKET_ERROR)
return SOCKET_ERROR;
if (ret == SOCKET_ERROR)
return SOCKET_ERROR;
-int wxSocketImplMSW::Send_Stream(const char *buffer, int size)
+int wxSocketImplMSW::Send_Stream(const void *buffer, int size)
- return send(m_fd, buffer, size, 0);
+ return send(m_fd, static_cast<const char *>(buffer), size, 0);
-int wxSocketImplMSW::Send_Dgram(const char *buffer, int size)
+int wxSocketImplMSW::Send_Dgram(const void *buffer, int size)
{
struct sockaddr *addr;
int len, ret;
{
struct sockaddr *addr;
int len, ret;
- ret = sendto(m_fd, buffer, size, 0, addr, len);
+ ret = sendto(m_fd, static_cast<const char *>(buffer), size, 0, addr, len);
/* Frees memory allocated by _GAddress_translate_to */
free(addr);
/* Frees memory allocated by _GAddress_translate_to */
free(addr);
/* Generic IO */
/* Like recv(), send(), ... */
/* Generic IO */
/* Like recv(), send(), ... */
-int wxSocketImplUnix::Read(char *buffer, int size)
+int wxSocketImplUnix::Read(void *buffer, int size)
-int wxSocketImplUnix::Write(const char *buffer, int size)
+int wxSocketImplUnix::Write(const void *buffer, int size)
return wxSOCKET_NOERROR;
}
return wxSOCKET_NOERROR;
}
-int wxSocketImplUnix::Recv_Stream(char *buffer, int size)
+int wxSocketImplUnix::Recv_Stream(void *buffer, int size)
-int wxSocketImplUnix::Recv_Dgram(char *buffer, int size)
+int wxSocketImplUnix::Recv_Dgram(void *buffer, int size)
{
wxSockAddr from;
WX_SOCKLEN_T fromlen = sizeof(from);
{
wxSockAddr from;
WX_SOCKLEN_T fromlen = sizeof(from);
-int wxSocketImplUnix::Send_Stream(const char *buffer, int size)
+int wxSocketImplUnix::Send_Stream(const void *buffer, int size)
- ret = send(m_fd, (char *)buffer, size, GSOCKET_MSG_NOSIGNAL);
+ ret = send(m_fd, buffer, size, GSOCKET_MSG_NOSIGNAL);
}
while (ret == -1 && errno == EINTR); /* Loop until not interrupted */
}
while (ret == -1 && errno == EINTR); /* Loop until not interrupted */
-int wxSocketImplUnix::Send_Dgram(const char *buffer, int size)
+int wxSocketImplUnix::Send_Dgram(const void *buffer, int size)
{
struct sockaddr *addr;
int len, ret;
{
struct sockaddr *addr;
int len, ret;
- ret = sendto(m_fd, (char *)buffer, size, 0, addr, len);
+ ret = sendto(m_fd, buffer, size, 0, addr, len);
}
while (ret == -1 && errno == EINTR); /* Loop until not interrupted */
}
while (ret == -1 && errno == EINTR); /* Loop until not interrupted */