Discover if a full jid (bare jid + resource) is available (not offline)

How can I disover if a given full jid is currently available (not offline)? What would happen if I send a message to a full jid that has gone offline? Would there be an error or would the server route the message to the next available resource of this jid?