/* 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);
{
/* 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) {
/* 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, (void*)&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, optval, (SOCKLEN_T*)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, (void*)&error, &len);