/* Table of GUI-related functions. We must call them indirectly because
* of wxBase and GUI separation: */
/* Table of GUI-related functions. We must call them indirectly because
* of wxBase and GUI separation: */
virtual bool Init_Socket(GSocket *socket);
virtual void Destroy_Socket(GSocket *socket);
virtual void Install_Callback(GSocket *socket, GSocketEvent event);
virtual bool Init_Socket(GSocket *socket);
virtual void Destroy_Socket(GSocket *socket);
virtual void Install_Callback(GSocket *socket, GSocketEvent event);
virtual void Uninstall_Callback(GSocket *socket, GSocketEvent event);
virtual void Enable_Events(GSocket *socket);
virtual void Disable_Events(GSocket *socket);
virtual void Uninstall_Callback(GSocket *socket, GSocketEvent event);
virtual void Enable_Events(GSocket *socket);
virtual void Disable_Events(GSocket *socket);
gs_gui_functions->Enable_Events(this);
/* allow a socket to re-bind if the socket is in the TIME_WAIT
gs_gui_functions->Enable_Events(this);
/* allow a socket to re-bind if the socket is in the TIME_WAIT
m_error = GSOCK_MEMERR;
return NULL;
}
err = _GAddress_translate_from(connection->m_peer, &from, fromlen);
if (err != GSOCK_NOERROR)
{
m_error = GSOCK_MEMERR;
return NULL;
}
err = _GAddress_translate_from(connection->m_peer, &from, fromlen);
if (err != GSOCK_NOERROR)
{
{
/* socket must not be null, and must not be in use/already bound */
if (this && m_fd == INVALID_SOCKET) {
{
/* socket must not be null, and must not be in use/already bound */
if (this && m_fd == INVALID_SOCKET) {
- getsockopt(m_fd, SOL_SOCKET, SO_ERROR, (void*) &error, &len);
+ getsockopt(m_fd, SOL_SOCKET, SO_ERROR, (char*) &error, &len);
/* Do not use a static struct, Linux can garble it */
tv.tv_sec = m_timeout / 1000;
/* Do not use a static struct, Linux can garble it */
tv.tv_sec = m_timeout / 1000;
- getsockopt(m_fd, SOL_SOCKET, SO_ERROR, (void*)&error, &len);
+ getsockopt(m_fd, SOL_SOCKET, SO_ERROR, (char*)&error, &len);
/* Check for exceptions and errors (is this useful in Unices?) */
if (FD_ISSET(m_fd, &exceptfds))
{
/* Check for exceptions and errors (is this useful in Unices?) */
if (FD_ISSET(m_fd, &exceptfds))
{
GSocketError GSocket::GetSockOpt(int level, int optname,
void *optval, int *optlen)
{
GSocketError GSocket::GetSockOpt(int level, int optname,
void *optval, int *optlen)
{
- if (getsockopt(m_fd, level, optname, optval, optlen) == 0)
+ if (getsockopt(m_fd, level, optname, (char*)optval, (SOCKOPTLEN_T*)optlen) == 0)
GSocketError GSocket::SetSockOpt(int level, int optname,
const void *optval, int optlen)
{
GSocketError GSocket::SetSockOpt(int level, int optname,
const void *optval, int optlen)
{
- if (setsockopt(m_fd, level, optname, optval, optlen) == 0)
+ if (setsockopt(m_fd, level, optname, (const char*)optval, optlen) == 0)
if (socket->m_cbacks[event]) \
socket->m_cbacks[event](socket, event, socket->m_data[event]); \
}
if (socket->m_cbacks[event]) \
socket->m_cbacks[event](socket, event, socket->m_data[event]); \
}
- getsockopt(m_fd, SOL_SOCKET, SO_ERROR, (void*)&error, &len);
+ getsockopt(m_fd, SOL_SOCKET, SO_ERROR, (char*)&error, &len);