本文整理汇总了C#中System.Net.Sockets.SafeSocketHandle.DangerousGetHandle方法的典型用法代码示例。如果您正苦于以下问题:C# SafeSocketHandle.DangerousGetHandle方法的具体用法?C# SafeSocketHandle.DangerousGetHandle怎么用?C# SafeSocketHandle.DangerousGetHandle使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Net.Sockets.SafeSocketHandle
的用法示例。
在下文中一共展示了SafeSocketHandle.DangerousGetHandle方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: IOControl_internal
static int IOControl_internal (SafeSocketHandle safeHandle, int ioctl_code, byte [] input, byte [] output, out int error)
{
bool release = false;
try {
safeHandle.DangerousAddRef (ref release);
return IOControl_internal (safeHandle.DangerousGetHandle (), ioctl_code, input, output, out error);
} finally {
if (release)
safeHandle.DangerousRelease ();
}
}
示例2: Shutdown_internal
static void Shutdown_internal (SafeSocketHandle safeHandle, SocketShutdown how, out int error)
{
bool release = false;
try {
safeHandle.DangerousAddRef (ref release);
Shutdown_internal (safeHandle.DangerousGetHandle (), how, out error);
} finally {
if (release)
safeHandle.DangerousRelease ();
}
}
示例3: SendFile_internal
static bool SendFile_internal (SafeSocketHandle safeHandle, string filename, byte [] pre_buffer, byte [] post_buffer, TransmitFileOptions flags)
{
try {
safeHandle.RegisterForBlockingSyscall ();
return SendFile_internal (safeHandle.DangerousGetHandle (), filename, pre_buffer, post_buffer, flags);
} finally {
safeHandle.UnRegisterForBlockingSyscall ();
}
}
示例4: SetSocketOption_internal
static void SetSocketOption_internal (SafeSocketHandle safeHandle, SocketOptionLevel level, SocketOptionName name, object obj_val, byte [] byte_val, int int_val, out int error)
{
bool release = false;
try {
safeHandle.DangerousAddRef (ref release);
SetSocketOption_internal (safeHandle.DangerousGetHandle (), level, name, obj_val, byte_val, int_val, out error);
} finally {
if (release)
safeHandle.DangerousRelease ();
}
}
示例5: GetSocketOption_arr_internal
private static void GetSocketOption_arr_internal (SafeSocketHandle safeHandle,
SocketOptionLevel level, SocketOptionName name, ref byte[] byte_val,
out int error)
{
bool release = false;
try {
safeHandle.DangerousAddRef (ref release);
GetSocketOption_arr_internal (safeHandle.DangerousGetHandle (), level, name, ref byte_val, out error);
} finally {
if (release)
safeHandle.DangerousRelease ();
}
}
示例6: SendTo_internal
static int SendTo_internal (SafeSocketHandle safeHandle, byte[] buffer, int offset, int count, SocketFlags flags, SocketAddress sa, out int error)
{
try {
safeHandle.RegisterForBlockingSyscall ();
return SendTo_internal (safeHandle.DangerousGetHandle (), buffer, offset, count, flags, sa, out error);
} finally {
safeHandle.UnRegisterForBlockingSyscall ();
}
}
示例7: Disconnect_internal
static void Disconnect_internal (SafeSocketHandle safeHandle, bool reuse, out int error)
{
bool release = false;
try {
safeHandle.DangerousAddRef (ref release);
Disconnect_internal (safeHandle.DangerousGetHandle (), reuse, out error);
} finally {
if (release)
safeHandle.DangerousRelease ();
}
}
示例8: RemoteEndPoint_internal
static SocketAddress RemoteEndPoint_internal (SafeSocketHandle safeHandle, int family, out int error)
{
bool release = false;
try {
safeHandle.DangerousAddRef (ref release);
return RemoteEndPoint_internal (safeHandle.DangerousGetHandle (), family, out error);
} finally {
if (release)
safeHandle.DangerousRelease ();
}
}
示例9: Listen_internal
static void Listen_internal (SafeSocketHandle safeHandle, int backlog, out int error)
{
bool release = false;
try {
safeHandle.DangerousAddRef (ref release);
Listen_internal (safeHandle.DangerousGetHandle (), backlog, out error);
} finally {
if (release)
safeHandle.DangerousRelease ();
}
}
示例10: Connect_internal
static void Connect_internal (SafeSocketHandle safeHandle, SocketAddress sa, out int error)
{
try {
safeHandle.RegisterForBlockingSyscall ();
Connect_internal (safeHandle.DangerousGetHandle (), sa, out error);
} finally {
safeHandle.UnRegisterForBlockingSyscall ();
}
}
示例11: Bind_internal
private static void Bind_internal (SafeSocketHandle safeHandle, SocketAddress sa, out int error)
{
bool release = false;
try {
safeHandle.DangerousAddRef (ref release);
Bind_internal (safeHandle.DangerousGetHandle (), sa, out error);
} finally {
if (release)
safeHandle.DangerousRelease ();
}
}
示例12: Accept_internal
static SafeSocketHandle Accept_internal (SafeSocketHandle safeHandle, out int error, bool blocking)
{
try {
safeHandle.RegisterForBlockingSyscall ();
var ret = Accept_internal (safeHandle.DangerousGetHandle (), out error, blocking);
return new SafeSocketHandle (ret, true);
} finally {
safeHandle.UnRegisterForBlockingSyscall ();
}
}
示例13: RecvFrom_internal
private static int RecvFrom_internal (SafeSocketHandle safeHandle,
byte[] buffer,
int offset,
int count,
SocketFlags flags,
ref SocketAddress sockaddr,
out int error)
{
try {
safeHandle.RegisterForBlockingSyscall ();
return RecvFrom_internal (safeHandle.DangerousGetHandle (), buffer, offset, count, flags, ref sockaddr, out error);
} finally {
safeHandle.UnRegisterForBlockingSyscall ();
}
}
示例14: Available_internal
static int Available_internal (SafeSocketHandle safeHandle, out int error)
{
bool release = false;
try {
safeHandle.DangerousAddRef (ref release);
return Available_internal (safeHandle.DangerousGetHandle (), out error);
} finally {
if (release)
safeHandle.DangerousRelease ();
}
}
示例15: Receive_internal
static int Receive_internal (SafeSocketHandle safeHandle, WSABUF[] bufarray, SocketFlags flags, out int error)
{
try {
safeHandle.RegisterForBlockingSyscall ();
return Receive_internal (safeHandle.DangerousGetHandle (), bufarray, flags, out error);
} finally {
safeHandle.UnRegisterForBlockingSyscall ();
}
}