int silc_socket_stream_get_error(SilcStream stream);
If error occurred during socket stream operations, this function can be used to retrieve the error number that occurred.