Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
dlib
Commits
06501db2
Commit
06501db2
authored
Nov 17, 2012
by
Davis King
Browse files
simplified examples
parent
e56b4c53
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
5 deletions
+3
-5
examples/sockets_ex_2.cpp
examples/sockets_ex_2.cpp
+1
-1
examples/sockstreambuf_ex.cpp
examples/sockstreambuf_ex.cpp
+2
-4
No files found.
examples/sockets_ex_2.cpp
View file @
06501db2
...
...
@@ -34,7 +34,7 @@ int main()
{
// Create a stream buffer for our connection
sockstreambuf
::
kernel_2a
buf
(
con
);
sockstreambuf
buf
(
con
);
// Now stick that stream buffer into an iostream object
iostream
stream
(
&
buf
);
// This command causes the iostream to flush its output buffers
...
...
examples/sockstreambuf_ex.cpp
View file @
06501db2
...
...
@@ -39,10 +39,8 @@ class serv : public server
connection
&
con
)
{
// create a sockstreambuf that reads/writes on our connection. I'm using the
// kernel_2a version here because it is generally the faster of the two versions in the
// library.
sockstreambuf
::
kernel_2a
buf
(
&
con
);
// create a sockstreambuf that reads/writes on our connection.
sockstreambuf
buf
(
&
con
);
// Now we make an iostream object that reads/writes to our streambuffer. A lot of people
// don't seem to know that the C++ iostreams are as powerful as they are. So what I'm doing
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment