title: OPC-UA: recv(buffersize) function gets stuck without any error/warning message
body: <p><strong>Some information about my relevant-to-the-thread background:</strong></p>
  <ul>
  <li><p>Client-Server connection domain knowledge: Beginner</p>
  </li>
  <li><p>Python-programmer: Mid to advanced level</p>
  </li>
  </ul>
  <p><strong>Problem I am facing:</strong></p>
  <p>connecting a Client to a Server using the OPCUA protocol (tool I am using: opcua python-library and VS-code editor).</p>
  <p><strong>How did the problem start?</strong></p>
  <ul>
  <li>I was attempting to use the <code>node.get_value()</code> method (where <code>node = client.get_node(&quot;ns=2;i=2&quot;)</code>). Then the error is: &quot;None type does not have a method called 'send_request'&quot;. This made me think that the socket connection is not established. Therefore, I tried to establish a socket connection first, by using the <code>UAClient.connect_socket()</code> method, which lead me to the origin of the problem, which is the last command line in the following code:</li>
  </ul>
  <p><strong>My code:</strong></p>
  <pre><code>from opcua import Server
  from opcua import Client
  from opcua import ua
  from ua_client import *
  from traceback import print_exc
  from opcua import Client
  
  
  
  name = &quot;OPC_SIMULATION_SERVER&quot; 
  addspace = server.register_namespace(name)
  node = server.get_objects_node()
  Param = node.add_object(addspace, &quot;Parameters&quot;)
  
  server = Server() 
  url = 'opc.tcp://127.0.0.1:4840' # opc server URL (connection works, checked in in command line with &quot;ping&quot;)
  
  server.start()
  print(&quot;Server started at {}&quot;.format(url))
  
  client = Client(url) # create client object
  ref = client.uaclient # create UAClient object
  # establish socket (to my understanding)
  ref._uasocket = UASocketClient(ref._timeout, security_policy=ref.security_policy)
  host = client.server_url.hostname
  port = client.server_url.port
  refsock = ref._uasocket
  sock = socket.create_connection((host, port), timeout=refsock.timeout)
  sock.settimeout(None) # for blocking (doesn’t cause the error)
  sock.setsockopt(socket.IPPROTO_TCP, socket.TCP_NODELAY, 1)
  refsock._socket = ua.utils.SocketWrapper(sock)
  
  # ERRATIC LINE: The following command gets stuck without an error/warning message
  chunk = refsock._socket.socket.recv(8)
  # \==================================================
  </code></pre>
  <p>I should note that initially I had no problem with getting the value from the node.</p>