Added typehinting and MODE_NOBLOCK