Panda3D
bioStream.cxx
Go to the documentation of this file.
1 /**
2  * PANDA 3D SOFTWARE
3  * Copyright (c) Carnegie Mellon University. All rights reserved.
4  *
5  * All use of this software is subject to the terms of the revised BSD
6  * license. You should have received a copy of this license along
7  * with this source code in a file named "LICENSE."
8  *
9  * @file bioStream.cxx
10  * @author drose
11  * @date 2002-09-25
12  */
13 
14 #include "bioStream.h"
15 
16 
17 #ifdef HAVE_OPENSSL
18 
19 /**
20  * Returns true if the last eof condition was triggered because the socket has
21  * genuinely closed, or false if we can expect more data to come along
22  * shortly.
23  */
24 bool IBioStream::
25 is_closed() {
26  if (!_buf._read_open) {
27  return true;
28  }
29  clear();
30  return false;
31 }
32 
33 /**
34  * Resets the BioStream to empty, but does not actually close the source BIO
35  * unless owns_source was true.
36  */
37 void IBioStream::
38 close() {
39  _buf.close();
40 }
41 
42 /**
43  * Returns true if the last write fail condition was triggered because the
44  * socket has genuinely closed, or false if we can expect to send more data
45  * along shortly.
46  */
47 bool OBioStream::
48 is_closed() {
49  if (!_buf._write_open) {
50  return true;
51  }
52  clear();
53  return false;
54 }
55 
56 /**
57  * Resets the BioStream to empty, but does not actually close the source BIO
58  * unless owns_source was true.
59  */
60 void OBioStream::
61 close() {
62  _buf.close();
63 }
64 
65 /**
66  * Returns true if the last eof or failure condition was triggered because the
67  * socket has genuinely closed, or false if we can expect to read or send more
68  * data shortly.
69  */
70 bool BioStream::
71 is_closed() {
72  if (!_buf._read_open) {
73  return true;
74  }
75  clear();
76  return false;
77 }
78 
79 /**
80  * Resets the BioStream to empty, but does not actually close the source BIO
81  * unless owns_source was true.
82  */
83 void BioStream::
84 close() {
85  _buf.close();
86 }
87 
88 /**
89  * Returns an enum indicating how we are coming along in reading the document.
90  */
91 IBioStream::ReadState IBioStream::
92 get_read_state() {
93  // For an IBioStream, this method is meaningless, and always returns
94  // RS_error.
95 
96  // This method is intended for those specialized streams that scan through
97  // an HTTP document.
98  return RS_error;
99 }
100 
101 #endif // HAVE_OPENSSL
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.