Socket class done the C++ way

M

Mikael S. H.

I've been trying to make a socket class. So far, it's been up and down,
getting many different pieces of advice along the way.
Now I've made it a bit functional, although it is doing nothing to check
for errors, and is probably done terribly badly with fds and FILE*s.

Now, I've found out it should inherit the streambuf class. I've found a
class doing this, but it is way too complicated for my learning
capabilities.

Could someone please direct me to the Path that is C++?

I'm not including code, since it's probably crappy, and uses a lot of
files not relevant to this question. If you want it, just ask.
 
R

Roland Pibinger

I've been trying to make a socket class. So far, it's been up and down,
getting many different pieces of advice along the way.
Now I've made it a bit functional, although it is doing nothing to check
for errors, and is probably done terribly badly with fds and FILE*s.

Now, I've found out it should inherit the streambuf class. I've found a
class doing this, but it is way too complicated for my learning
capabilities.

Could someone please direct me to the Path that is C++?

http://www.msobczak.com/prog/bin/sockets.zip
 
L

Larry I Smith

Mikael said:
I've been trying to make a socket class. So far, it's been up and down,
getting many different pieces of advice along the way.
Now I've made it a bit functional, although it is doing nothing to check
for errors, and is probably done terribly badly with fds and FILE*s.

Now, I've found out it should inherit the streambuf class. I've found a
class doing this, but it is way too complicated for my learning
capabilities.

Could someone please direct me to the Path that is C++?

I'm not including code, since it's probably crappy, and uses a lot of
files not relevant to this question. If you want it, just ask.

http://freshmeat.net/projects/csockets/

<quote>
C++ Sockets is a C++ wrapper for BSD-style sockets. Its features include
transparent SOCKS4 client support and asynchronous DNS. It implements
the TCP, UDP, ICMP, HTTP (GET, PUT, and POST), and HTTPS (using OpenSSL)
protocols.
</quote>

Regards,
Larry
 
L

loquacious

Mikael said:
Now, I've found out it should inherit the streambuf class. I've found a
class doing this, but it is way too complicated for my learning
capabilities.

IMO Socket++ Library should satisfy your needs. Apart from
from being streamable it implements unix domain sockets
and internet sockets. I think it has been compiled on few
flavour of unix. For more information you can check out
the site.

http://members.aon.at/hstraub/linux/socket++/

Thank you,
Nitin Motgi
 
L

loquacious

Mikael said:
I'm not including code, since it's probably crappy, and uses a lot of
files not relevant to this question. If you want it, just ask.

It's small and has very good examples that would help you a lot

Thank you,
Nitin Motgi
 
L

loufoque

Mikael S. H. a écrit :
I've been trying to make a socket class. So far, it's been up and down,
getting many different pieces of advice along the way.
Now I've made it a bit functional, although it is doing nothing to check
for errors, and is probably done terribly badly with fds and FILE*s.

Now, I've found out it should inherit the streambuf class. I've found a
class doing this, but it is way too complicated for my learning
capabilities.

Could someone please direct me to the Path that is C++?

I'm not including code, since it's probably crappy, and uses a lot of
files not relevant to this question. If you want it, just ask.

You might want to check out ASIO too.
http://asio.sourceforge.net/
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,432
Messages
2,571,680
Members
48,796
Latest member
Greg L.

Latest Threads

Top