]>
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(void *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 void *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(void *buffer
, int size
)
383 return recv(m_fd
, static_cast<char *>(buffer
), size
, 0);
386 int wxSocketImplMSW::Recv_Dgram(void *buffer
, int size
)
389 WX_SOCKLEN_T fromlen
= sizeof(from
);
393 ret
= recvfrom(m_fd
, static_cast<char *>(buffer
),
394 size
, 0, &from
, &fromlen
);
396 if (ret
== SOCKET_ERROR
)
399 /* Translate a system address into a wxSocketImpl address */
402 m_peer
= GAddress_new();
405 m_error
= wxSOCKET_MEMERR
;
409 err
= _GAddress_translate_from(m_peer
, (sockaddr
*)&from
, fromlen
);
410 if (err
!= wxSOCKET_NOERROR
)
412 GAddress_destroy(m_peer
);
421 int wxSocketImplMSW::Send_Stream(const void *buffer
, int size
)
423 return send(m_fd
, static_cast<const char *>(buffer
), size
, 0);
426 int wxSocketImplMSW::Send_Dgram(const void *buffer
, int size
)
428 struct sockaddr
*addr
;
434 m_error
= wxSOCKET_INVADDR
;
438 err
= _GAddress_translate_to(m_peer
, &addr
, &len
);
439 if (err
!= wxSOCKET_NOERROR
)
445 ret
= sendto(m_fd
, static_cast<const char *>(buffer
), size
, 0, addr
, len
);
447 /* Frees memory allocated by _GAddress_translate_to */
454 * -------------------------------------------------------------------------
456 * -------------------------------------------------------------------------
459 /* CHECK_ADDRESS verifies that the current address family is either
460 * wxSOCKET_NOFAMILY or wxSOCKET_*family*, and if it is wxSOCKET_NOFAMILY, it
461 * initalizes it to be a wxSOCKET_*family*. In other cases, it returns
462 * an appropiate error code.
464 * CHECK_ADDRESS_RETVAL does the same but returning 'retval' on error.
466 #define CHECK_ADDRESS(address, family) \
468 if (address->m_family == wxSOCKET_NOFAMILY) \
469 if (_GAddress_Init_##family(address) != wxSOCKET_NOERROR) \
470 return address->m_error; \
471 if (address->m_family != wxSOCKET_##family) \
473 address->m_error = wxSOCKET_INVADDR; \
474 return wxSOCKET_INVADDR; \
478 #define CHECK_ADDRESS_RETVAL(address, family, retval) \
480 if (address->m_family == wxSOCKET_NOFAMILY) \
481 if (_GAddress_Init_##family(address) != wxSOCKET_NOERROR) \
483 if (address->m_family != wxSOCKET_##family) \
485 address->m_error = wxSOCKET_INVADDR; \
491 GAddress
*GAddress_new()
495 if ((address
= (GAddress
*) malloc(sizeof(GAddress
))) == NULL
)
498 address
->m_family
= wxSOCKET_NOFAMILY
;
499 address
->m_addr
= NULL
;
505 GAddress
*GAddress_copy(GAddress
*address
)
509 if ((addr2
= (GAddress
*) malloc(sizeof(GAddress
))) == NULL
)
512 memcpy(addr2
, address
, sizeof(GAddress
));
516 addr2
->m_addr
= (struct sockaddr
*) malloc(addr2
->m_len
);
517 if (addr2
->m_addr
== NULL
)
522 memcpy(addr2
->m_addr
, address
->m_addr
, addr2
->m_len
);
528 void GAddress_destroy(GAddress
*address
)
531 free(address
->m_addr
);
536 void GAddress_SetFamily(GAddress
*address
, GAddressType type
)
538 address
->m_family
= type
;
541 GAddressType
GAddress_GetFamily(GAddress
*address
)
543 return address
->m_family
;
546 wxSocketError
_GAddress_translate_from(GAddress
*address
,
547 struct sockaddr
*addr
, int len
)
549 address
->m_realfamily
= addr
->sa_family
;
550 switch (addr
->sa_family
)
553 address
->m_family
= wxSOCKET_INET
;
556 address
->m_family
= wxSOCKET_UNIX
;
560 address
->m_family
= wxSOCKET_INET6
;
565 address
->m_error
= wxSOCKET_INVOP
;
566 return wxSOCKET_INVOP
;
571 free(address
->m_addr
);
573 address
->m_len
= len
;
574 address
->m_addr
= (struct sockaddr
*) malloc(len
);
576 if (address
->m_addr
== NULL
)
578 address
->m_error
= wxSOCKET_MEMERR
;
579 return wxSOCKET_MEMERR
;
581 memcpy(address
->m_addr
, addr
, len
);
583 return wxSOCKET_NOERROR
;
586 wxSocketError
_GAddress_translate_to(GAddress
*address
,
587 struct sockaddr
**addr
, int *len
)
589 if (!address
->m_addr
)
591 address
->m_error
= wxSOCKET_INVADDR
;
592 return wxSOCKET_INVADDR
;
595 *len
= address
->m_len
;
596 *addr
= (struct sockaddr
*) malloc(address
->m_len
);
599 address
->m_error
= wxSOCKET_MEMERR
;
600 return wxSOCKET_MEMERR
;
603 memcpy(*addr
, address
->m_addr
, address
->m_len
);
604 return wxSOCKET_NOERROR
;
608 * -------------------------------------------------------------------------
609 * Internet address family
610 * -------------------------------------------------------------------------
613 wxSocketError
_GAddress_Init_INET(GAddress
*address
)
615 address
->m_len
= sizeof(struct sockaddr_in
);
616 address
->m_addr
= (struct sockaddr
*) malloc(address
->m_len
);
617 if (address
->m_addr
== NULL
)
619 address
->m_error
= wxSOCKET_MEMERR
;
620 return wxSOCKET_MEMERR
;
623 address
->m_family
= wxSOCKET_INET
;
624 address
->m_realfamily
= AF_INET
;
625 ((struct sockaddr_in
*)address
->m_addr
)->sin_family
= AF_INET
;
626 ((struct sockaddr_in
*)address
->m_addr
)->sin_addr
.s_addr
= INADDR_ANY
;
628 return wxSOCKET_NOERROR
;
631 wxSocketError
GAddress_INET_SetHostName(GAddress
*address
, const char *hostname
)
634 struct in_addr
*addr
;
636 CHECK_ADDRESS(address
, INET
);
638 addr
= &(((struct sockaddr_in
*)address
->m_addr
)->sin_addr
);
640 addr
->s_addr
= inet_addr(hostname
);
642 /* If it is a numeric host name, convert it now */
643 if (addr
->s_addr
== INADDR_NONE
)
645 struct in_addr
*array_addr
;
647 /* It is a real name, we solve it */
648 if ((he
= gethostbyname(hostname
)) == NULL
)
650 /* addr->s_addr = INADDR_NONE just done by inet_addr() above */
651 address
->m_error
= wxSOCKET_NOHOST
;
652 return wxSOCKET_NOHOST
;
654 array_addr
= (struct in_addr
*) *(he
->h_addr_list
);
655 addr
->s_addr
= array_addr
[0].s_addr
;
657 return wxSOCKET_NOERROR
;
660 wxSocketError
GAddress_INET_SetBroadcastAddress(GAddress
*address
)
662 return GAddress_INET_SetHostAddress(address
, INADDR_BROADCAST
);
665 wxSocketError
GAddress_INET_SetAnyAddress(GAddress
*address
)
667 return GAddress_INET_SetHostAddress(address
, INADDR_ANY
);
670 wxSocketError
GAddress_INET_SetHostAddress(GAddress
*address
,
671 unsigned long hostaddr
)
673 struct in_addr
*addr
;
675 CHECK_ADDRESS(address
, INET
);
677 addr
= &(((struct sockaddr_in
*)address
->m_addr
)->sin_addr
);
678 addr
->s_addr
= htonl(hostaddr
);
680 return wxSOCKET_NOERROR
;
683 wxSocketError
GAddress_INET_SetPortName(GAddress
*address
, const char *port
,
684 const char *protocol
)
687 struct sockaddr_in
*addr
;
689 CHECK_ADDRESS(address
, INET
);
693 address
->m_error
= wxSOCKET_INVPORT
;
694 return wxSOCKET_INVPORT
;
697 se
= getservbyname(port
, protocol
);
700 if (isdigit(port
[0]))
704 port_int
= atoi(port
);
705 addr
= (struct sockaddr_in
*)address
->m_addr
;
706 addr
->sin_port
= htons((u_short
) port_int
);
707 return wxSOCKET_NOERROR
;
710 address
->m_error
= wxSOCKET_INVPORT
;
711 return wxSOCKET_INVPORT
;
714 addr
= (struct sockaddr_in
*)address
->m_addr
;
715 addr
->sin_port
= se
->s_port
;
717 return wxSOCKET_NOERROR
;
720 wxSocketError
GAddress_INET_SetPort(GAddress
*address
, unsigned short port
)
722 struct sockaddr_in
*addr
;
724 CHECK_ADDRESS(address
, INET
);
726 addr
= (struct sockaddr_in
*)address
->m_addr
;
727 addr
->sin_port
= htons(port
);
729 return wxSOCKET_NOERROR
;
732 wxSocketError
GAddress_INET_GetHostName(GAddress
*address
, char *hostname
, size_t sbuf
)
736 struct sockaddr_in
*addr
;
738 CHECK_ADDRESS(address
, INET
);
740 addr
= (struct sockaddr_in
*)address
->m_addr
;
741 addr_buf
= (char *)&(addr
->sin_addr
);
743 he
= gethostbyaddr(addr_buf
, sizeof(addr
->sin_addr
), AF_INET
);
746 address
->m_error
= wxSOCKET_NOHOST
;
747 return wxSOCKET_NOHOST
;
750 strncpy(hostname
, he
->h_name
, sbuf
);
752 return wxSOCKET_NOERROR
;
755 unsigned long GAddress_INET_GetHostAddress(GAddress
*address
)
757 struct sockaddr_in
*addr
;
759 CHECK_ADDRESS_RETVAL(address
, INET
, 0);
761 addr
= (struct sockaddr_in
*)address
->m_addr
;
763 return ntohl(addr
->sin_addr
.s_addr
);
766 unsigned short GAddress_INET_GetPort(GAddress
*address
)
768 struct sockaddr_in
*addr
;
770 CHECK_ADDRESS_RETVAL(address
, INET
, 0);
772 addr
= (struct sockaddr_in
*)address
->m_addr
;
773 return ntohs(addr
->sin_port
);
779 * -------------------------------------------------------------------------
780 * Internet IPv6 address family
781 * -------------------------------------------------------------------------
783 #include "ws2tcpip.h"
786 #pragma comment(lib,"ws2_32")
787 #endif // __VISUALC__
789 wxSocketError
_GAddress_Init_INET6(GAddress
*address
)
791 struct in6_addr any_address
= IN6ADDR_ANY_INIT
;
792 address
->m_len
= sizeof(struct sockaddr_in6
);
793 address
->m_addr
= (struct sockaddr
*) malloc(address
->m_len
);
794 if (address
->m_addr
== NULL
)
796 address
->m_error
= wxSOCKET_MEMERR
;
797 return wxSOCKET_MEMERR
;
799 memset(address
->m_addr
,0,address
->m_len
);
801 address
->m_family
= wxSOCKET_INET6
;
802 address
->m_realfamily
= AF_INET6
;
803 ((struct sockaddr_in6
*)address
->m_addr
)->sin6_family
= AF_INET6
;
804 ((struct sockaddr_in6
*)address
->m_addr
)->sin6_addr
= any_address
;
806 return wxSOCKET_NOERROR
;
809 wxSocketError
GAddress_INET6_SetHostName(GAddress
*address
, const char *hostname
)
811 CHECK_ADDRESS(address
, INET6
);
814 memset( & hints
, 0, sizeof( hints
) );
815 hints
.ai_family
= AF_INET6
;
817 if ( getaddrinfo( hostname
, "0", & hints
, & info
) || ! info
)
819 address
->m_error
= wxSOCKET_NOHOST
;
820 return wxSOCKET_NOHOST
;
823 memcpy( address
->m_addr
, info
->ai_addr
, info
->ai_addrlen
);
824 freeaddrinfo( info
);
825 return wxSOCKET_NOERROR
;
828 wxSocketError
GAddress_INET6_SetAnyAddress(GAddress
*address
)
830 CHECK_ADDRESS(address
, INET6
);
832 struct in6_addr addr
;
833 memset( & addr
, 0, sizeof( addr
) );
834 return GAddress_INET6_SetHostAddress(address
, addr
);
836 wxSocketError
GAddress_INET6_SetHostAddress(GAddress
*address
,
837 struct in6_addr hostaddr
)
839 CHECK_ADDRESS(address
, INET6
);
841 ((struct sockaddr_in6
*)address
->m_addr
)->sin6_addr
= hostaddr
;
843 return wxSOCKET_NOERROR
;
846 wxSocketError
GAddress_INET6_SetPortName(GAddress
*address
, const char *port
,
847 const char *protocol
)
850 struct sockaddr_in6
*addr
;
852 CHECK_ADDRESS(address
, INET6
);
856 address
->m_error
= wxSOCKET_INVPORT
;
857 return wxSOCKET_INVPORT
;
860 se
= getservbyname(port
, protocol
);
863 if (isdigit((unsigned char) port
[0]))
867 port_int
= atoi(port
);
868 addr
= (struct sockaddr_in6
*)address
->m_addr
;
869 addr
->sin6_port
= htons((u_short
) port_int
);
870 return wxSOCKET_NOERROR
;
873 address
->m_error
= wxSOCKET_INVPORT
;
874 return wxSOCKET_INVPORT
;
877 addr
= (struct sockaddr_in6
*)address
->m_addr
;
878 addr
->sin6_port
= se
->s_port
;
880 return wxSOCKET_NOERROR
;
883 wxSocketError
GAddress_INET6_SetPort(GAddress
*address
, unsigned short port
)
885 struct sockaddr_in6
*addr
;
887 CHECK_ADDRESS(address
, INET6
);
889 addr
= (struct sockaddr_in6
*)address
->m_addr
;
890 addr
->sin6_port
= htons(port
);
892 return wxSOCKET_NOERROR
;
895 wxSocketError
GAddress_INET6_GetHostName(GAddress
*address
, char *hostname
, size_t sbuf
)
899 struct sockaddr_in6
*addr
;
901 CHECK_ADDRESS(address
, INET6
);
903 addr
= (struct sockaddr_in6
*)address
->m_addr
;
904 addr_buf
= (char *)&(addr
->sin6_addr
);
906 he
= gethostbyaddr(addr_buf
, sizeof(addr
->sin6_addr
), AF_INET6
);
909 address
->m_error
= wxSOCKET_NOHOST
;
910 return wxSOCKET_NOHOST
;
913 strncpy(hostname
, he
->h_name
, sbuf
);
915 return wxSOCKET_NOERROR
;
918 wxSocketError
GAddress_INET6_GetHostAddress(GAddress
*address
,struct in6_addr
*hostaddr
)
920 CHECK_ADDRESS_RETVAL(address
, INET6
, wxSOCKET_INVADDR
);
921 *hostaddr
= ( (struct sockaddr_in6
*)address
->m_addr
)->sin6_addr
;
922 return wxSOCKET_NOERROR
;
925 unsigned short GAddress_INET6_GetPort(GAddress
*address
)
927 CHECK_ADDRESS_RETVAL(address
, INET6
, 0);
929 return ntohs( ((struct sockaddr_in6
*)address
->m_addr
)->sin6_port
);
935 * -------------------------------------------------------------------------
936 * Unix address family
937 * -------------------------------------------------------------------------
940 wxSocketError
_GAddress_Init_UNIX(GAddress
*address
)
942 address
->m_error
= wxSOCKET_INVADDR
;
943 return wxSOCKET_INVADDR
;
946 wxSocketError
GAddress_UNIX_SetPath(GAddress
*address
, const char *WXUNUSED(path
))
948 address
->m_error
= wxSOCKET_INVADDR
;
949 return wxSOCKET_INVADDR
;
952 wxSocketError
GAddress_UNIX_GetPath(GAddress
*address
, char *WXUNUSED(path
), size_t WXUNUSED(sbuf
))
954 address
->m_error
= wxSOCKET_INVADDR
;
955 return wxSOCKET_INVADDR
;
958 #endif // wxUSE_SOCKETS