]>
git.saurik.com Git - wxWidgets.git/blob - src/msw/gsocket.cpp
1 /* -------------------------------------------------------------------------
2 * Project: wxSocketImpl (Generic Socket)
3 * Name: src/msw/gsocket.cpp
4 * Copyright: (c) Guilhem Lavaux
5 * Licence: wxWindows Licence
6 * Author: Guillermo Rodriguez Garcia <guille@iies.es>
7 * Purpose: wxSocketImpl main MSW file
8 * Licence: The wxWindows licence
10 * -------------------------------------------------------------------------
13 // For compilers that support precompilation, includes "wx.h".
14 #include "wx/wxprec.h"
21 /* RPCNOTIFICATION_ROUTINE in rasasync.h (included from winsock.h),
22 * warning: conditional expression is constant.
24 # pragma warning(disable:4115)
26 * warning: named type definition in parentheses.
28 # pragma warning(disable:4127)
29 /* GAddress_UNIX_GetPath,
30 * warning: unreferenced formal parameter.
32 # pragma warning(disable:4100)
35 /* windows.h results in tons of warnings at max warning level */
37 # pragma warning(push, 1)
42 # pragma warning(disable:4514)
48 #if defined(__CYGWIN__)
49 //CYGWIN gives annoying warning about runtime stuff if we don't do this
50 # define USE_SYS_TYPES_FD_SET
51 # include <sys/types.h>
56 #include "wx/platform.h"
60 #include "wx/private/socket.h"
63 wxFORCE_LINK_MODULE(gsockmsw
)
67 #define isdigit(x) (x > 47 && x < 58)
69 #include "wx/msw/wince/net.h"
78 #include "wx/private/socket.h"
81 wxSocketImpl
*wxSocketImpl::Create(wxSocketBase
& wxsocket
)
83 return new wxSocketImplMSW(wxsocket
);
86 void wxSocketImplMSW::DoClose()
88 wxSocketManager::Get()->
89 Uninstall_Callback(this, wxSOCKET_MAX_EVENT
/* unused anyhow */);
95 * Waits for an incoming client connection. Returns a pointer to
96 * a wxSocketImpl object, or NULL if there was an error, in which case
97 * the last error field will be updated for the calling wxSocketImpl.
99 * Error codes (set in the calling wxSocketImpl)
100 * wxSOCKET_INVSOCK - the socket is not valid or not a server.
101 * wxSOCKET_TIMEDOUT - timeout, no incoming connections.
102 * wxSOCKET_WOULDBLOCK - the call would block and the socket is nonblocking.
103 * wxSOCKET_MEMERR - couldn't allocate memory.
104 * wxSOCKET_IOERR - low-level error.
106 wxSocketImpl
*wxSocketImplMSW::WaitConnection(wxSocketBase
& wxsocket
)
108 wxSocketImpl
*connection
;
110 WX_SOCKLEN_T fromlen
= sizeof(from
);
114 /* Reenable CONNECTION events */
115 m_detected
&= ~wxSOCKET_CONNECTION_FLAG
;
117 /* If the socket has already been created, we exit immediately */
118 if (m_fd
== INVALID_SOCKET
|| !m_server
)
120 m_error
= wxSOCKET_INVSOCK
;
124 /* Create a wxSocketImpl object for the new connection */
125 connection
= wxSocketImplMSW::Create(wxsocket
);
129 m_error
= wxSOCKET_MEMERR
;
133 /* Wait for a connection (with timeout) */
134 if (Input_Timeout() == wxSOCKET_TIMEDOUT
)
137 /* m_error set by Input_Timeout */
141 connection
->m_fd
= accept(m_fd
, (sockaddr
*)&from
, &fromlen
);
143 if (connection
->m_fd
== INVALID_SOCKET
)
145 if (WSAGetLastError() == WSAEWOULDBLOCK
)
146 m_error
= wxSOCKET_WOULDBLOCK
;
148 m_error
= wxSOCKET_IOERR
;
154 /* Initialize all fields */
155 connection
->m_server
= false;
156 connection
->m_stream
= true;
158 /* Setup the peer address field */
159 connection
->m_peer
= GAddress_new();
160 if (!connection
->m_peer
)
163 m_error
= wxSOCKET_MEMERR
;
166 err
= _GAddress_translate_from(connection
->m_peer
, (sockaddr
*)&from
, fromlen
);
167 if (err
!= wxSOCKET_NOERROR
)
169 GAddress_destroy(connection
->m_peer
);
175 ioctlsocket(connection
->m_fd
, FIONBIO
, (u_long FAR
*) &arg
);
176 wxSocketManager::Get()->Install_Callback(connection
);
181 wxSocketError
wxSocketImplMSW::DoHandleConnect(int ret
)
184 if (ret
== SOCKET_ERROR
)
186 int err
= WSAGetLastError();
188 /* If connect failed with EWOULDBLOCK and the wxSocketImpl object
189 * is in blocking mode, we select() for the specified timeout
190 * checking for writability to see if the connection request
193 if ((err
== WSAEWOULDBLOCK
) && (!m_non_blocking
))
195 err
= Connect_Timeout();
197 if (err
!= wxSOCKET_NOERROR
)
200 /* m_error is set in Connect_Timeout */
203 return (wxSocketError
) err
;
206 /* If connect failed with EWOULDBLOCK and the wxSocketImpl object
207 * is set to nonblocking, we set m_error to wxSOCKET_WOULDBLOCK
208 * (and return wxSOCKET_WOULDBLOCK) but we don't close the socket;
209 * this way if the connection completes, a wxSOCKET_CONNECTION
210 * event will be generated, if enabled.
212 if ((err
== WSAEWOULDBLOCK
) && (m_non_blocking
))
214 m_establishing
= true;
215 m_error
= wxSOCKET_WOULDBLOCK
;
216 return wxSOCKET_WOULDBLOCK
;
219 /* If connect failed with an error other than EWOULDBLOCK,
220 * then the call to Connect() has failed.
223 m_error
= wxSOCKET_IOERR
;
224 return wxSOCKET_IOERR
;
227 return wxSOCKET_NOERROR
;
232 /* Like recv(), send(), ... */
233 int wxSocketImplMSW::Read(char *buffer
, int size
)
237 /* Reenable INPUT events */
238 m_detected
&= ~wxSOCKET_INPUT_FLAG
;
240 if (m_fd
== INVALID_SOCKET
|| m_server
)
242 m_error
= wxSOCKET_INVSOCK
;
246 /* If the socket is blocking, wait for data (with a timeout) */
247 if (Input_Timeout() == wxSOCKET_TIMEDOUT
)
249 m_error
= wxSOCKET_TIMEDOUT
;
255 ret
= Recv_Stream(buffer
, size
);
257 ret
= Recv_Dgram(buffer
, size
);
259 if (ret
== SOCKET_ERROR
)
261 if (WSAGetLastError() != WSAEWOULDBLOCK
)
262 m_error
= wxSOCKET_IOERR
;
264 m_error
= wxSOCKET_WOULDBLOCK
;
271 int wxSocketImplMSW::Write(const char *buffer
, int size
)
275 if (m_fd
== INVALID_SOCKET
|| m_server
)
277 m_error
= wxSOCKET_INVSOCK
;
281 /* If the socket is blocking, wait for writability (with a timeout) */
282 if (Output_Timeout() == wxSOCKET_TIMEDOUT
)
287 ret
= Send_Stream(buffer
, size
);
289 ret
= Send_Dgram(buffer
, size
);
291 if (ret
== SOCKET_ERROR
)
293 if (WSAGetLastError() != WSAEWOULDBLOCK
)
294 m_error
= wxSOCKET_IOERR
;
296 m_error
= wxSOCKET_WOULDBLOCK
;
298 /* Only reenable OUTPUT events after an error (just like WSAAsyncSelect
299 * does). Once the first OUTPUT event is received, users can assume
300 * that the socket is writable until a read operation fails. Only then
301 * will further OUTPUT events be posted.
303 m_detected
&= ~wxSOCKET_OUTPUT_FLAG
;
313 * For blocking sockets, wait until data is available or
314 * until timeout ellapses.
316 wxSocketError
wxSocketImplMSW::Input_Timeout()
323 FD_SET(m_fd
, &readfds
);
324 if (select(0, &readfds
, NULL
, NULL
, &m_timeout
) == 0)
326 m_error
= wxSOCKET_TIMEDOUT
;
327 return wxSOCKET_TIMEDOUT
;
330 return wxSOCKET_NOERROR
;
334 * For blocking sockets, wait until data can be sent without
335 * blocking or until timeout ellapses.
337 wxSocketError
wxSocketImplMSW::Output_Timeout()
344 FD_SET(m_fd
, &writefds
);
345 if (select(0, NULL
, &writefds
, NULL
, &m_timeout
) == 0)
347 m_error
= wxSOCKET_TIMEDOUT
;
348 return wxSOCKET_TIMEDOUT
;
351 return wxSOCKET_NOERROR
;
355 * For blocking sockets, wait until the connection is
356 * established or fails, or until timeout ellapses.
358 wxSocketError
wxSocketImplMSW::Connect_Timeout()
365 FD_SET(m_fd
, &writefds
);
366 FD_SET(m_fd
, &exceptfds
);
367 if (select(0, NULL
, &writefds
, &exceptfds
, &m_timeout
) == 0)
369 m_error
= wxSOCKET_TIMEDOUT
;
370 return wxSOCKET_TIMEDOUT
;
372 if (!FD_ISSET(m_fd
, &writefds
))
374 m_error
= wxSOCKET_IOERR
;
375 return wxSOCKET_IOERR
;
378 return wxSOCKET_NOERROR
;
381 int wxSocketImplMSW::Recv_Stream(char *buffer
, int size
)
383 return recv(m_fd
, buffer
, size
, 0);
386 int wxSocketImplMSW::Recv_Dgram(char *buffer
, int size
)
389 WX_SOCKLEN_T fromlen
= sizeof(from
);
393 ret
= recvfrom(m_fd
, buffer
, size
, 0, (sockaddr
*)&from
, &fromlen
);
395 if (ret
== SOCKET_ERROR
)
398 /* Translate a system address into a wxSocketImpl address */
401 m_peer
= GAddress_new();
404 m_error
= wxSOCKET_MEMERR
;
408 err
= _GAddress_translate_from(m_peer
, (sockaddr
*)&from
, fromlen
);
409 if (err
!= wxSOCKET_NOERROR
)
411 GAddress_destroy(m_peer
);
420 int wxSocketImplMSW::Send_Stream(const char *buffer
, int size
)
422 return send(m_fd
, buffer
, size
, 0);
425 int wxSocketImplMSW::Send_Dgram(const char *buffer
, int size
)
427 struct sockaddr
*addr
;
433 m_error
= wxSOCKET_INVADDR
;
437 err
= _GAddress_translate_to(m_peer
, &addr
, &len
);
438 if (err
!= wxSOCKET_NOERROR
)
444 ret
= sendto(m_fd
, buffer
, size
, 0, addr
, len
);
446 /* Frees memory allocated by _GAddress_translate_to */
453 * -------------------------------------------------------------------------
455 * -------------------------------------------------------------------------
458 /* CHECK_ADDRESS verifies that the current address family is either
459 * wxSOCKET_NOFAMILY or wxSOCKET_*family*, and if it is wxSOCKET_NOFAMILY, it
460 * initalizes it to be a wxSOCKET_*family*. In other cases, it returns
461 * an appropiate error code.
463 * CHECK_ADDRESS_RETVAL does the same but returning 'retval' on error.
465 #define CHECK_ADDRESS(address, family) \
467 if (address->m_family == wxSOCKET_NOFAMILY) \
468 if (_GAddress_Init_##family(address) != wxSOCKET_NOERROR) \
469 return address->m_error; \
470 if (address->m_family != wxSOCKET_##family) \
472 address->m_error = wxSOCKET_INVADDR; \
473 return wxSOCKET_INVADDR; \
477 #define CHECK_ADDRESS_RETVAL(address, family, retval) \
479 if (address->m_family == wxSOCKET_NOFAMILY) \
480 if (_GAddress_Init_##family(address) != wxSOCKET_NOERROR) \
482 if (address->m_family != wxSOCKET_##family) \
484 address->m_error = wxSOCKET_INVADDR; \
490 GAddress
*GAddress_new()
494 if ((address
= (GAddress
*) malloc(sizeof(GAddress
))) == NULL
)
497 address
->m_family
= wxSOCKET_NOFAMILY
;
498 address
->m_addr
= NULL
;
504 GAddress
*GAddress_copy(GAddress
*address
)
508 if ((addr2
= (GAddress
*) malloc(sizeof(GAddress
))) == NULL
)
511 memcpy(addr2
, address
, sizeof(GAddress
));
515 addr2
->m_addr
= (struct sockaddr
*) malloc(addr2
->m_len
);
516 if (addr2
->m_addr
== NULL
)
521 memcpy(addr2
->m_addr
, address
->m_addr
, addr2
->m_len
);
527 void GAddress_destroy(GAddress
*address
)
530 free(address
->m_addr
);
535 void GAddress_SetFamily(GAddress
*address
, GAddressType type
)
537 address
->m_family
= type
;
540 GAddressType
GAddress_GetFamily(GAddress
*address
)
542 return address
->m_family
;
545 wxSocketError
_GAddress_translate_from(GAddress
*address
,
546 struct sockaddr
*addr
, int len
)
548 address
->m_realfamily
= addr
->sa_family
;
549 switch (addr
->sa_family
)
552 address
->m_family
= wxSOCKET_INET
;
555 address
->m_family
= wxSOCKET_UNIX
;
559 address
->m_family
= wxSOCKET_INET6
;
564 address
->m_error
= wxSOCKET_INVOP
;
565 return wxSOCKET_INVOP
;
570 free(address
->m_addr
);
572 address
->m_len
= len
;
573 address
->m_addr
= (struct sockaddr
*) malloc(len
);
575 if (address
->m_addr
== NULL
)
577 address
->m_error
= wxSOCKET_MEMERR
;
578 return wxSOCKET_MEMERR
;
580 memcpy(address
->m_addr
, addr
, len
);
582 return wxSOCKET_NOERROR
;
585 wxSocketError
_GAddress_translate_to(GAddress
*address
,
586 struct sockaddr
**addr
, int *len
)
588 if (!address
->m_addr
)
590 address
->m_error
= wxSOCKET_INVADDR
;
591 return wxSOCKET_INVADDR
;
594 *len
= address
->m_len
;
595 *addr
= (struct sockaddr
*) malloc(address
->m_len
);
598 address
->m_error
= wxSOCKET_MEMERR
;
599 return wxSOCKET_MEMERR
;
602 memcpy(*addr
, address
->m_addr
, address
->m_len
);
603 return wxSOCKET_NOERROR
;
607 * -------------------------------------------------------------------------
608 * Internet address family
609 * -------------------------------------------------------------------------
612 wxSocketError
_GAddress_Init_INET(GAddress
*address
)
614 address
->m_len
= sizeof(struct sockaddr_in
);
615 address
->m_addr
= (struct sockaddr
*) malloc(address
->m_len
);
616 if (address
->m_addr
== NULL
)
618 address
->m_error
= wxSOCKET_MEMERR
;
619 return wxSOCKET_MEMERR
;
622 address
->m_family
= wxSOCKET_INET
;
623 address
->m_realfamily
= AF_INET
;
624 ((struct sockaddr_in
*)address
->m_addr
)->sin_family
= AF_INET
;
625 ((struct sockaddr_in
*)address
->m_addr
)->sin_addr
.s_addr
= INADDR_ANY
;
627 return wxSOCKET_NOERROR
;
630 wxSocketError
GAddress_INET_SetHostName(GAddress
*address
, const char *hostname
)
633 struct in_addr
*addr
;
635 CHECK_ADDRESS(address
, INET
);
637 addr
= &(((struct sockaddr_in
*)address
->m_addr
)->sin_addr
);
639 addr
->s_addr
= inet_addr(hostname
);
641 /* If it is a numeric host name, convert it now */
642 if (addr
->s_addr
== INADDR_NONE
)
644 struct in_addr
*array_addr
;
646 /* It is a real name, we solve it */
647 if ((he
= gethostbyname(hostname
)) == NULL
)
649 /* addr->s_addr = INADDR_NONE just done by inet_addr() above */
650 address
->m_error
= wxSOCKET_NOHOST
;
651 return wxSOCKET_NOHOST
;
653 array_addr
= (struct in_addr
*) *(he
->h_addr_list
);
654 addr
->s_addr
= array_addr
[0].s_addr
;
656 return wxSOCKET_NOERROR
;
659 wxSocketError
GAddress_INET_SetBroadcastAddress(GAddress
*address
)
661 return GAddress_INET_SetHostAddress(address
, INADDR_BROADCAST
);
664 wxSocketError
GAddress_INET_SetAnyAddress(GAddress
*address
)
666 return GAddress_INET_SetHostAddress(address
, INADDR_ANY
);
669 wxSocketError
GAddress_INET_SetHostAddress(GAddress
*address
,
670 unsigned long hostaddr
)
672 struct in_addr
*addr
;
674 CHECK_ADDRESS(address
, INET
);
676 addr
= &(((struct sockaddr_in
*)address
->m_addr
)->sin_addr
);
677 addr
->s_addr
= htonl(hostaddr
);
679 return wxSOCKET_NOERROR
;
682 wxSocketError
GAddress_INET_SetPortName(GAddress
*address
, const char *port
,
683 const char *protocol
)
686 struct sockaddr_in
*addr
;
688 CHECK_ADDRESS(address
, INET
);
692 address
->m_error
= wxSOCKET_INVPORT
;
693 return wxSOCKET_INVPORT
;
696 se
= getservbyname(port
, protocol
);
699 if (isdigit(port
[0]))
703 port_int
= atoi(port
);
704 addr
= (struct sockaddr_in
*)address
->m_addr
;
705 addr
->sin_port
= htons((u_short
) port_int
);
706 return wxSOCKET_NOERROR
;
709 address
->m_error
= wxSOCKET_INVPORT
;
710 return wxSOCKET_INVPORT
;
713 addr
= (struct sockaddr_in
*)address
->m_addr
;
714 addr
->sin_port
= se
->s_port
;
716 return wxSOCKET_NOERROR
;
719 wxSocketError
GAddress_INET_SetPort(GAddress
*address
, unsigned short port
)
721 struct sockaddr_in
*addr
;
723 CHECK_ADDRESS(address
, INET
);
725 addr
= (struct sockaddr_in
*)address
->m_addr
;
726 addr
->sin_port
= htons(port
);
728 return wxSOCKET_NOERROR
;
731 wxSocketError
GAddress_INET_GetHostName(GAddress
*address
, char *hostname
, size_t sbuf
)
735 struct sockaddr_in
*addr
;
737 CHECK_ADDRESS(address
, INET
);
739 addr
= (struct sockaddr_in
*)address
->m_addr
;
740 addr_buf
= (char *)&(addr
->sin_addr
);
742 he
= gethostbyaddr(addr_buf
, sizeof(addr
->sin_addr
), AF_INET
);
745 address
->m_error
= wxSOCKET_NOHOST
;
746 return wxSOCKET_NOHOST
;
749 strncpy(hostname
, he
->h_name
, sbuf
);
751 return wxSOCKET_NOERROR
;
754 unsigned long GAddress_INET_GetHostAddress(GAddress
*address
)
756 struct sockaddr_in
*addr
;
758 CHECK_ADDRESS_RETVAL(address
, INET
, 0);
760 addr
= (struct sockaddr_in
*)address
->m_addr
;
762 return ntohl(addr
->sin_addr
.s_addr
);
765 unsigned short GAddress_INET_GetPort(GAddress
*address
)
767 struct sockaddr_in
*addr
;
769 CHECK_ADDRESS_RETVAL(address
, INET
, 0);
771 addr
= (struct sockaddr_in
*)address
->m_addr
;
772 return ntohs(addr
->sin_port
);
778 * -------------------------------------------------------------------------
779 * Internet IPv6 address family
780 * -------------------------------------------------------------------------
782 #include "ws2tcpip.h"
785 #pragma comment(lib,"ws2_32")
786 #endif // __VISUALC__
788 wxSocketError
_GAddress_Init_INET6(GAddress
*address
)
790 struct in6_addr any_address
= IN6ADDR_ANY_INIT
;
791 address
->m_len
= sizeof(struct sockaddr_in6
);
792 address
->m_addr
= (struct sockaddr
*) malloc(address
->m_len
);
793 if (address
->m_addr
== NULL
)
795 address
->m_error
= wxSOCKET_MEMERR
;
796 return wxSOCKET_MEMERR
;
798 memset(address
->m_addr
,0,address
->m_len
);
800 address
->m_family
= wxSOCKET_INET6
;
801 address
->m_realfamily
= AF_INET6
;
802 ((struct sockaddr_in6
*)address
->m_addr
)->sin6_family
= AF_INET6
;
803 ((struct sockaddr_in6
*)address
->m_addr
)->sin6_addr
= any_address
;
805 return wxSOCKET_NOERROR
;
808 wxSocketError
GAddress_INET6_SetHostName(GAddress
*address
, const char *hostname
)
810 CHECK_ADDRESS(address
, INET6
);
813 memset( & hints
, 0, sizeof( hints
) );
814 hints
.ai_family
= AF_INET6
;
816 if ( getaddrinfo( hostname
, "0", & hints
, & info
) || ! info
)
818 address
->m_error
= wxSOCKET_NOHOST
;
819 return wxSOCKET_NOHOST
;
822 memcpy( address
->m_addr
, info
->ai_addr
, info
->ai_addrlen
);
823 freeaddrinfo( info
);
824 return wxSOCKET_NOERROR
;
827 wxSocketError
GAddress_INET6_SetAnyAddress(GAddress
*address
)
829 CHECK_ADDRESS(address
, INET6
);
831 struct in6_addr addr
;
832 memset( & addr
, 0, sizeof( addr
) );
833 return GAddress_INET6_SetHostAddress(address
, addr
);
835 wxSocketError
GAddress_INET6_SetHostAddress(GAddress
*address
,
836 struct in6_addr hostaddr
)
838 CHECK_ADDRESS(address
, INET6
);
840 ((struct sockaddr_in6
*)address
->m_addr
)->sin6_addr
= hostaddr
;
842 return wxSOCKET_NOERROR
;
845 wxSocketError
GAddress_INET6_SetPortName(GAddress
*address
, const char *port
,
846 const char *protocol
)
849 struct sockaddr_in6
*addr
;
851 CHECK_ADDRESS(address
, INET6
);
855 address
->m_error
= wxSOCKET_INVPORT
;
856 return wxSOCKET_INVPORT
;
859 se
= getservbyname(port
, protocol
);
862 if (isdigit((unsigned char) port
[0]))
866 port_int
= atoi(port
);
867 addr
= (struct sockaddr_in6
*)address
->m_addr
;
868 addr
->sin6_port
= htons((u_short
) port_int
);
869 return wxSOCKET_NOERROR
;
872 address
->m_error
= wxSOCKET_INVPORT
;
873 return wxSOCKET_INVPORT
;
876 addr
= (struct sockaddr_in6
*)address
->m_addr
;
877 addr
->sin6_port
= se
->s_port
;
879 return wxSOCKET_NOERROR
;
882 wxSocketError
GAddress_INET6_SetPort(GAddress
*address
, unsigned short port
)
884 struct sockaddr_in6
*addr
;
886 CHECK_ADDRESS(address
, INET6
);
888 addr
= (struct sockaddr_in6
*)address
->m_addr
;
889 addr
->sin6_port
= htons(port
);
891 return wxSOCKET_NOERROR
;
894 wxSocketError
GAddress_INET6_GetHostName(GAddress
*address
, char *hostname
, size_t sbuf
)
898 struct sockaddr_in6
*addr
;
900 CHECK_ADDRESS(address
, INET6
);
902 addr
= (struct sockaddr_in6
*)address
->m_addr
;
903 addr_buf
= (char *)&(addr
->sin6_addr
);
905 he
= gethostbyaddr(addr_buf
, sizeof(addr
->sin6_addr
), AF_INET6
);
908 address
->m_error
= wxSOCKET_NOHOST
;
909 return wxSOCKET_NOHOST
;
912 strncpy(hostname
, he
->h_name
, sbuf
);
914 return wxSOCKET_NOERROR
;
917 wxSocketError
GAddress_INET6_GetHostAddress(GAddress
*address
,struct in6_addr
*hostaddr
)
919 CHECK_ADDRESS_RETVAL(address
, INET6
, wxSOCKET_INVADDR
);
920 *hostaddr
= ( (struct sockaddr_in6
*)address
->m_addr
)->sin6_addr
;
921 return wxSOCKET_NOERROR
;
924 unsigned short GAddress_INET6_GetPort(GAddress
*address
)
926 CHECK_ADDRESS_RETVAL(address
, INET6
, 0);
928 return ntohs( ((struct sockaddr_in6
*)address
->m_addr
)->sin6_port
);
934 * -------------------------------------------------------------------------
935 * Unix address family
936 * -------------------------------------------------------------------------
939 wxSocketError
_GAddress_Init_UNIX(GAddress
*address
)
941 address
->m_error
= wxSOCKET_INVADDR
;
942 return wxSOCKET_INVADDR
;
945 wxSocketError
GAddress_UNIX_SetPath(GAddress
*address
, const char *WXUNUSED(path
))
947 address
->m_error
= wxSOCKET_INVADDR
;
948 return wxSOCKET_INVADDR
;
951 wxSocketError
GAddress_UNIX_GetPath(GAddress
*address
, char *WXUNUSED(path
), size_t WXUNUSED(sbuf
))
953 address
->m_error
= wxSOCKET_INVADDR
;
954 return wxSOCKET_INVADDR
;
957 #endif // wxUSE_SOCKETS