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

◆ DoBind()

void System.Net.Sockets.Socket.DoBind ( EndPoint endPointSnapshot,
System::Net::Internals::SocketAddress socketAddress )
inlineprivate

Definition at line 1191 of file Socket.cs.

1192 {
1193 IPEndPoint iPEndPoint = endPointSnapshot as IPEndPoint;
1194 if (!OSSupportsIPv4 && iPEndPoint != null && iPEndPoint.Address.IsIPv4MappedToIPv6)
1195 {
1196 UpdateStatusAfterSocketErrorAndThrowException(SocketError.InvalidArgument, "DoBind");
1197 }
1198 SocketError socketError = SocketPal.Bind(_handle, _protocolType, socketAddress.Buffer, socketAddress.Size);
1199 if (socketError != 0)
1200 {
1202 }
1203 _rightEndPoint = ((endPointSnapshot is UnixDomainSocketEndPoint unixDomainSocketEndPoint) ? unixDomainSocketEndPoint.CreateBoundEndPoint() : endPointSnapshot);
1204 }
static bool OSSupportsIPv4
Definition Socket.cs:589
SafeSocketHandle _handle
Definition Socket.cs:533
ProtocolType _protocolType
Definition Socket.cs:559
void UpdateStatusAfterSocketErrorAndThrowException(SocketError error, [CallerMemberName] string callerName=null)
Definition Socket.cs:3715

References System.Net.Sockets.Socket._handle, System.Net.Sockets.Socket._protocolType, System.Net.Sockets.Socket._rightEndPoint, System.Net.Sockets.SocketPal.Bind(), System.Net.Sockets.Socket.OSSupportsIPv4, and System.Net.Sockets.Socket.UpdateStatusAfterSocketErrorAndThrowException().

Referenced by System.Net.Sockets.Socket.Bind(), and System.Net.Sockets.Socket.WildcardBindForConnectIfNecessary().