def _SendRecv():
 port = int(os.getenv(DEVSHELL_ENV, 0))
 if (port == 0):
  raise NoDevshellServer()
 import socket
 sock = socket.socket()
 sock.connect(('localhost', port))
 data = CREDENTIAL_INFO_REQUEST_JSON
 msg = ('%s\n%s' % (len(data), data))
 sock.sendall(msg.encode())
 header = sock.recv(6).decode()
 if ('\n' not in header):
  raise CommunicationError('saw no newline in the first 6 bytes')
 (len_str, json_str) = header.split('\n', 1)
 to_read = (int(len_str) - len(json_str))
 if (to_read > 0):
  json_str += sock.recv(to_read, socket.MSG_WAITALL).decode()
 return CredentialInfoResponse(json_str)

def _SendRecv ( ) : port = int ( os . getenv ( DEVSHELL_ENV , 0 ) ) if ( port == 0 ) : raise NoDevshellServer ( ) import socket sock = socket . socket ( ) sock . connect ( ( 'localhost' , port ) ) data = CREDENTIAL_INFO_REQUEST_JSON msg = ( '%s\n%s' % ( len ( data ) , data ) ) sock . sendall ( msg . encode ( ) ) header = sock . recv ( 6 ) . decode ( ) if ( '\n' not in header ) : raise CommunicationError ( 'saw no newline in the first 6 bytes' ) ( len_str , json_str ) = header . split ( '\n' , 1 ) to_read = ( int ( len_str ) - len ( json_str ) ) if ( to_read > 0 ) : json_str += sock . recv ( to_read , socket . MSG_WAITALL ) . decode ( ) return CredentialInfoResponse ( json_str )
communicate with the developer shell server socket .