/// <exception cref="System.IO.IOException"></exception>
internal virtual void EnsureOpen(int timeout)
{
_closeTimeout = 0;
if (SoTimeout != 0)
{
_closeTimeout = Math.Max(SoTimeout, timeout);
}
// If socket is still good, the new closeTimeout will
// be ignored; see tryClose comment.
if (_socket == null)
{
_socket = new SocketEx(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp);
//IPAddress.`Address` property deleted
//_socket.Bind(new IPEndPoint(laddr.Address, _lport));
_socket.Bind(new IPEndPoint(laddr, _lport));
if (_waitResponse)
{
_thread = new Thread(this); //new Sharpen.Thread(this, "JCIFS-NameServiceClient");
_thread.SetDaemon(true);
_thread.Start();
}
}
}