1 #include "ace/OS_NS_stropts.h"
3 #if !defined (ACE_HAS_INLINED_OSCALLS)
4 # include "ace/OS_NS_stropts.inl"
5 #endif /* ACE_HAS_INLINED_OSCALLS */
7 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
10 ACE_OS::ioctl (ACE_HANDLE socket
,
11 unsigned long io_control_code
,
13 unsigned long in_buffer
,
15 unsigned long out_buffer
,
16 unsigned long *bytes_returned
,
17 ACE_OVERLAPPED
*overlapped
,
18 ACE_OVERLAPPED_COMPLETION_FUNC func
)
20 # if defined (ACE_HAS_WINSOCK2) && (ACE_HAS_WINSOCK2 != 0)
21 ACE_SOCKCALL_RETURN (::WSAIoctl ((ACE_SOCKET
) socket
,
28 (WSAOVERLAPPED
*) overlapped
,
33 ACE_UNUSED_ARG (socket
);
34 ACE_UNUSED_ARG (io_control_code
);
35 ACE_UNUSED_ARG (in_buffer_p
);
36 ACE_UNUSED_ARG (in_buffer
);
37 ACE_UNUSED_ARG (out_buffer_p
);
38 ACE_UNUSED_ARG (out_buffer
);
39 ACE_UNUSED_ARG (bytes_returned
);
40 ACE_UNUSED_ARG (overlapped
);
41 ACE_UNUSED_ARG (func
);
42 ACE_NOTSUP_RETURN (-1);
43 # endif /* ACE_HAS_WINSOCK2 */
47 ACE_OS::ioctl (ACE_HANDLE socket
,
48 unsigned long io_control_code
,
50 unsigned long *bytes_returned
,
53 ACE_OVERLAPPED
*overlapped
,
54 ACE_OVERLAPPED_COMPLETION_FUNC func
)
56 # if defined (ACE_HAS_WINSOCK2) && (ACE_HAS_WINSOCK2 != 0)
57 if (io_control_code
== SIO_SET_QOS
)
60 unsigned long qos_len
= sizeof (QOS
);
62 qos
.SendingFlowspec
= *(ace_qos
.sending_flowspec ());
63 qos
.ReceivingFlowspec
= *(ace_qos
.receiving_flowspec ());
64 qos
.ProviderSpecific
= (WSABUF
) ace_qos
.provider_specific ();
66 qos_len
+= ace_qos
.provider_specific ().iov_len
;
68 ACE_SOCKCALL_RETURN (::WSAIoctl ((ACE_SOCKET
) socket
,
75 (WSAOVERLAPPED
*) overlapped
,
82 unsigned long dwBufferLen
= 0;
84 // Query for the buffer size.
85 int result
= ::WSAIoctl ((ACE_SOCKET
) socket
,
96 if (result
== SOCKET_ERROR
)
98 unsigned long dwErr
= ::WSAGetLastError ();
100 if (dwErr
== WSAEWOULDBLOCK
)
106 if (dwErr
!= WSAENOBUFS
)
114 ACE_NEW_RETURN (qos_buf
,
118 QOS
*qos
= reinterpret_cast<QOS
*> (qos_buf
);
120 result
= ::WSAIoctl ((ACE_SOCKET
) socket
,
130 if (result
== SOCKET_ERROR
)
133 ACE_Flow_Spec
sending_flowspec (qos
->SendingFlowspec
.TokenRate
,
134 qos
->SendingFlowspec
.TokenBucketSize
,
135 qos
->SendingFlowspec
.PeakBandwidth
,
136 qos
->SendingFlowspec
.Latency
,
137 qos
->SendingFlowspec
.DelayVariation
,
138 # if defined(ACE_HAS_WINSOCK2_GQOS)
139 qos
->SendingFlowspec
.ServiceType
,
140 qos
->SendingFlowspec
.MaxSduSize
,
141 qos
->SendingFlowspec
.MinimumPolicedSize
,
142 # else /* ACE_HAS_WINSOCK2_GQOS */
146 # endif /* ACE_HAS_WINSOCK2_GQOS */
150 ACE_Flow_Spec
receiving_flowspec (qos
->ReceivingFlowspec
.TokenRate
,
151 qos
->ReceivingFlowspec
.TokenBucketSize
,
152 qos
->ReceivingFlowspec
.PeakBandwidth
,
153 qos
->ReceivingFlowspec
.Latency
,
154 qos
->ReceivingFlowspec
.DelayVariation
,
155 # if defined(ACE_HAS_WINSOCK2_GQOS)
156 qos
->ReceivingFlowspec
.ServiceType
,
157 qos
->ReceivingFlowspec
.MaxSduSize
,
158 qos
->ReceivingFlowspec
.MinimumPolicedSize
,
159 # else /* ACE_HAS_WINSOCK2_GQOS */
163 # endif /* ACE_HAS_WINSOCK2_GQOS */
167 ace_qos
.sending_flowspec (&sending_flowspec
);
168 ace_qos
.receiving_flowspec (&receiving_flowspec
);
169 ace_qos
.provider_specific (*((struct iovec
*) (&qos
->ProviderSpecific
)));
176 ACE_UNUSED_ARG (socket
);
177 ACE_UNUSED_ARG (io_control_code
);
178 ACE_UNUSED_ARG (ace_qos
);
179 ACE_UNUSED_ARG (bytes_returned
);
180 ACE_UNUSED_ARG (buffer_p
);
181 ACE_UNUSED_ARG (buffer
);
182 ACE_UNUSED_ARG (overlapped
);
183 ACE_UNUSED_ARG (func
);
184 ACE_NOTSUP_RETURN (-1);
185 # endif /* ACE_HAS_WINSOCK2 */
188 ACE_END_VERSIONED_NAMESPACE_DECL