c++ socket library



 DEVELOP > c-Plus-Plus > c++ socket library

LINK TO THIS PAGE  


rating :  0   |  0


  Page 1 of 1

1

 
Topic: DEVELOP > c-Plus-Plus
User: "mthread"
Date: 12 Dec 2007 04:26:22 AM
Object: c++ socket library
Hi,
I am planning to write a TCP/IP server. I would like to know if
any socket library is available for c++ or I have to use the socket
function calls in C.
.

User: "woolgate"

Title: Re: c++ socket library 12 Dec 2007 04:31:20 AM
ACE
"mthread" <rjkumr@gmail.com> wrote in message
news:865f4253-8db3-4816-8f38-b9eeaca752ea@t1g2000pra.googlegroups.com...



Hi,
I am planning to write a TCP/IP server. I would like to know if
any socket library is available for c++ or I have to use the socket
function calls in C.

.

User: "Ralf Globisch"

Title: Re: c++ socket library 12 Dec 2007 09:01:38 AM
On Dec 12, 12:26 pm, mthread <rjk...@gmail.com> wrote:

Hi,
I am planning to write a TCP/IP server. I would like to know if
any socket library is available for c++ or I have to use the socket
function calls in C.

Besides Ace, QT also offers networking classes which are very easy to
use, you'd have to check out their licensing model though...
.

User: "Peter"

Title: Re: c++ socket library 13 Dec 2007 08:07:10 PM
On Dec 12, 2:26 am, mthread <rjk...@gmail.com> wrote:

Hi,
I am planning to write a TCP/IP server. I would like to know if
any socket library is available for c++ or I have to use the socket
function calls in C.

First understand the socket library -- how to use it in C to write
your TCP/IP server.
Then recognize that there are pairs of function calls like e.g. socket/
close. accept/close.
Such pairs create classes with the do-action in the constructor and
the undo action in the destructor. I call such classes resource-
wrappers.
The constructor should throw something derived from std::exception in
case of the call fails.
The object thrown should contain every error information provided by
the system:
e.g. errno and the name of the function call which failed and maybe
some user supplied string which explains what has been attempted to
do.
From the saved errno you get the system error string via strerror.
IN the constructor create a std::string which contains the final error
message the user will see.
The what() method of the exception class will return what is returned
from the std::string.c_str().
Then recognize that there are functions which can also fail but do not
create a resource, like e.g. read/write. These belong into what I call
functional-wrappers.
A function returning void and calling the function to be wrapped.
If the function to be wrapped fails, again throw something containing
all the error information.
Finally you can write your TCP/IP server using these wrappers. You
will have to write a single try-catch block to deal with errors. The
code you're writing using these wrappers does not deal with errors
anymore.
.

User: "Boris"

Title: Re: c++ socket library 12 Dec 2007 05:06:55 AM
On Wed, 12 Dec 2007 12:26:22 +0200, mthread <rjkumr@gmail.com> wrote:

Hi,
I am planning to write a TCP/IP server. I would like to know if
any socket library is available for c++ or I have to use the socket
function calls in C.

Boost.Asio (see http://asio.sourceforge.net/; not yet part of the Boost
distribution although it has been accepted to Boost already).
Boris
.

User: "Tomás Ó hÉilidhe"

Title: Re: c++ socket library 12 Dec 2007 05:27:41 AM
mthread <rjkumr@gmail.com> wrote in news:865f4253-8db3-4816-8f38-
b9eeaca752ea@t1g2000pra.googlegroups.com:



Hi,
I am planning to write a TCP/IP server. I would like to know if
any socket library is available for c++ or I have to use the socket
function calls in C.

Could I take this opportunity to invite you to give your support for
the founding of "comp.lang.c++.cross-platform" (don't worry it doesn't
involve money!). You can vote for its founding by posting to the thread
entitled "RFD: comp.lang.c++.cross-platform" in the newsgroup
"news.groups.proposals". Every supporter counts, and we only need a couple
more to get the newsgroup up and running.
Comp.lang.c++.cross-platform would be a great place to discuss what
libraries to use for TCP/IP programming in C++, and for people to discuss
TCP/IP cross-platform programming in general.
--
Tomás Ó hÉilidhe
.
User: "Michael DOUBEZ"

Title: Re: c++ socket library 12 Dec 2007 06:25:10 AM
Tomás Ó hÉilidhe a écrit :

mthread <rjkumr@gmail.com> wrote in news:865f4253-8db3-4816-8f38-
b9eeaca752ea@t1g2000pra.googlegroups.com:


Hi,
I am planning to write a TCP/IP server. I would like to know if
any socket library is available for c++ or I have to use the socket
function calls in C.




Could I take this opportunity to invite you to give your support for
the founding of "comp.lang.c++.cross-platform" (don't worry it doesn't
involve money!). You can vote for its founding by posting to the thread
entitled "RFD: comp.lang.c++.cross-platform" in the newsgroup
"news.groups.proposals". Every supporter counts, and we only need a couple
more to get the newsgroup up and running.

I haven't seen any reference to cross-plateform requierement from the
OP. Some librairies/frameworks are more or less cross-plateform in order
to extend their user community or to effectively allow porting but it is
not the issue here.

Comp.lang.c++.cross-platform would be a great place to discuss what
libraries to use for TCP/IP programming in C++, and for people to discuss
TCP/IP cross-platform programming in general.

To the contrary, the OP would be better with a library that fits his
needs without the oddments due to interface factorisation.
Michael
.


User: "Michael DOUBEZ"

Title: Re: c++ socket library 12 Dec 2007 04:43:42 AM
mthread a écrit :


Hi,
I am planning to write a TCP/IP server. I would like to know if
any socket library is available for c++ or I have to use the socket
function calls in C.

There is no standard socket library in C++. You can google for
standalone library or you can use a framework like: ACE, Poco, gtk+ ...
Michael
.

User: "Andrea Venturoli"

Title: Re: c++ socket library 13 Dec 2007 12:47:54 PM
mthread ha scritto:


Hi,
I am planning to write a TCP/IP server. I would like to know if
any socket library is available for c++ or I have to use the socket
function calls in C.

I'm using: http://www.alhem.net/Sockets/
It has some glitches, but I choosed it for its light weight.
bye
av.
.

User: "Default User"

Title: Re: c++ socket library 12 Dec 2007 02:29:31 PM
mthread wrote:



Hi,
I am planning to write a TCP/IP server. I would like to know if
any socket library is available for c++ or I have to use the socket
function calls in C.

People have pointed out that there are no socket facilities in C++.
There also are none in C either. It's all platforms-specific stuff.
Brian
.
User: "Tomás Ó hÉilidhe"

Title: Re: c++ socket library 12 Dec 2007 03:09:53 PM
"Default User" <defaultuserbr@yahoo.com> wrote in news:5saulbF180f6cU1
@mid.individual.net:

People have pointed out that there are no socket facilities in C++.
There also are none in C either. It's all platforms-specific stuff.

Never heard of cross-platform libraries?
--
Tomás Ó hÉilidhe
.
User: "Default User"

Title: Re: c++ socket library 12 Dec 2007 04:31:16 PM
Tomas S hIilidhe wrote:

"Default User" <defaultuserbr@yahoo.com> wrote in news:5saulbF180f6cU1
@mid.individual.net:

People have pointed out that there are no socket facilities in C++.
There also are none in C either. It's all platforms-specific stuff.



Never heard of cross-platform libraries?

*plonk*
Brian
.
User: "mthread"

Title: Re: c++ socket library 12 Dec 2007 11:39:37 PM
On Dec 13, 3:31 am, "Default User" <defaultuse...@yahoo.com> wrote:

Tomas S hIilidhe wrote:

"Default User" <defaultuse...@yahoo.com> wrote in news:5saulbF180f6cU1
@mid.individual.net:


People have pointed out that there are no socket facilities in C++.
There also are none in C either. It's all platforms-specific stuff.


Never heard of cross-platform libraries?


*plonk*

Brian

Hi,
thanx everyone for the help
.
User: "Default User"

Title: Re: c++ socket library 13 Dec 2007 10:54:17 AM
mthread wrote:

On Dec 13, 3:31 am, "Default User" <defaultuse...@yahoo.com> wrote:

Tomas S hIilidhe wrote:

"Default User" <defaultuse...@yahoo.com> wrote in
news:5saulbF180f6cU1 @mid.individual.net:


People have pointed out that there are no socket facilities in
C++. There also are none in C either. It's all
platforms-specific stuff.


Never heard of cross-platform libraries?


plonk

thanx everyone for the help

Sure, let me know if there's anyone else I can plonk for you.
Brian
.






  Page 1 of 1

1

 


Related Articles
 

NEWER

pg.1232     pg.940     pg.716     pg.544     pg.412     pg.311     pg.234     pg.175     pg.130     pg.96     pg.70     pg.50     pg.35     pg.24     pg.16     pg.10     pg.6     pg.3     pg.1

OLDER