Click here to Skip to main content
Rate this: bad
Please Sign up or sign in to vote.
See more: C++
I have C++ classes for sockets: one class is for transmit and the other is for receive. I need to create a socket with which I can transmit and receive. Does anyone have such a class? Or some sort of implementation that provides this capability.
Posted 13-Sep-12 8:49am
Edited 13-Sep-12 8:50am
Philip Stuyck at 13-Sep-12 15:03pm
What do you mean ?
First you say : I have C++ classes for sockets.
Then you ask if anyone has such a class ?
Answer is: you have.
It is not that difficult to create a class wrapper around a socket.
Rate this: bad
Please Sign up or sign in to vote.

Solution 1

If you need to create a socket that is supposed to send over a specific port and not an ephemeral port, you need to bind the socket before sending.
I am answering the title here because the text does not make sense to me.
Rate this: bad
Please Sign up or sign in to vote.

Solution 2

You should create the sockets in your classes.
If you're are developing for the Windows platform then have a look at the code samples provided by MSDN[^].

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 OriginalGriff 428
1 Sergey Alexandrovich Kryukov 253
2 PhilLenoir 115
3 RajeeshMenoth 110
4 Peter Leow 100
0 Sergey Alexandrovich Kryukov 6,465
1 OriginalGriff 5,926
2 CPallini 2,473
3 Richard MacCutchan 1,687
4 Abhinav S 1,540

Advertise | Privacy | Mobile
Web02 | 2.8.140821.2 | Last Updated 13 Sep 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100