Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ DuplicateSocket()

static unsafe SocketError System.Net.Sockets.SocketPal.DuplicateSocket ( SafeSocketHandle handle,
int targetProcessId,
out SocketInformation socketInformation )
inlinestaticpackage

Definition at line 859 of file SocketPal.cs.

860 {
861 socketInformation = new SocketInformation
862 {
863 ProtocolInformation = new byte[sizeof(global::Interop.Winsock.WSAPROTOCOL_INFOW)]
864 };
865 fixed (byte* ptr = socketInformation.ProtocolInformation)
866 {
867 global::Interop.Winsock.WSAPROTOCOL_INFOW* lpProtocolInfo = (global::Interop.Winsock.WSAPROTOCOL_INFOW*)ptr;
868 if (global::Interop.Winsock.WSADuplicateSocket(handle, (uint)targetProcessId, lpProtocolInfo) != 0)
869 {
870 return GetLastSocketError();
871 }
872 return SocketError.Success;
873 }
874 }
static SocketError GetLastSocketError()
Definition SocketPal.cs:22

References System.Net.Sockets.SocketPal.GetLastSocketError(), and System.handle.

Referenced by System.Net.Sockets.Socket.DuplicateAndClose().