Please help!!! Winsock2/Sockets with C++ Console app?

Please support our C++ advertiser: Intel Parallel Studio Home
Reply

Join Date: Oct 2008
Posts: 36
Reputation: amerninja2 has a little shameless behaviour in the past 
Solved Threads: 0
amerninja2 amerninja2 is offline Offline
Light Poster

Please help!!! Winsock2/Sockets with C++ Console app?

 
-1
  #1
Dec 5th, 2008
Hello. I have been learning C++ for a while now. I know how to create C++ Console applications, and im wondering if theres any good tutorials on using Sockets/Winsock2 in C++ Console apps.

Please don't say I should learn Windows API, or MFC, I already know about those, and I will eventually get to WinAPI. But most of the tutorials I find on the internet either use Visual Basic, or Windows API/MFC with sockets.

If the Beej's sockets tutorial (Uses unix) using the extra windows thing it says in the tutorial will work with C++ Console apps, please tell me... Thanks!

P.S Can you try and tell me about Winsock2 instead of just Winsock, I've heard Winsock2 is better and more advanced.
Last edited by Ancient Dragon; Dec 6th, 2008 at 7:28 am. Reason: removed bold and color tags
Reply With Quote Quick reply to this message  
Join Date: Aug 2005
Posts: 15,359
Reputation: Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute 
Solved Threads: 1464
Team Colleague
Featured Poster
Ancient Dragon's Avatar
Ancient Dragon Ancient Dragon is offline Offline
Still Learning

Re: Please help!!! Winsock2/Sockets with C++ Console app?

 
0
  #2
Dec 6th, 2008
Oh gee golly moses. This was the first in the list of google links
Don't PM me with questions -- you might get a nasty PM in response. If you have a question then post it in one of the forums.
Reply With Quote Quick reply to this message  
Join Date: Oct 2008
Posts: 36
Reputation: amerninja2 has a little shameless behaviour in the past 
Solved Threads: 0
amerninja2 amerninja2 is offline Offline
Light Poster

Re: Please help!!! Winsock2/Sockets with C++ Console app?

 
0
  #3
Dec 6th, 2008
Oh im sorry about the bold bright text and stuff in my post!! I didn't know about that rule, ill be more carefull next time...

Anyway, thanks ill check that link out!
Reply With Quote Quick reply to this message  
Join Date: Oct 2008
Posts: 36
Reputation: amerninja2 has a little shameless behaviour in the past 
Solved Threads: 0
amerninja2 amerninja2 is offline Offline
Light Poster

Re: Please help!!! Winsock2/Sockets with C++ Console app?

 
0
  #4
Dec 6th, 2008
Well I just looked at that link, and it only shows using sockets with Window API/MFC. Im looking for one that is compatible for using in a C++/C console application, not Windows apps.
Reply With Quote Quick reply to this message  
Join Date: Apr 2008
Posts: 670
Reputation: Freaky_Chris is a jewel in the rough Freaky_Chris is a jewel in the rough Freaky_Chris is a jewel in the rough 
Solved Threads: 113
Freaky_Chris's Avatar
Freaky_Chris Freaky_Chris is offline Offline
Practically a Master Poster

Re: Please help!!! Winsock2/Sockets with C++ Console app?

 
0
  #5
Dec 6th, 2008
You can still use the windows API in your console application. There is no standard sockets implementation. So you need to use API calls, be it Win32 or POSIX.

Chris
Last edited by Freaky_Chris; Dec 6th, 2008 at 3:12 pm.
Knowledge is power -- But experience is everything
Reply With Quote Quick reply to this message  
Join Date: Oct 2008
Posts: 36
Reputation: amerninja2 has a little shameless behaviour in the past 
Solved Threads: 0
amerninja2 amerninja2 is offline Offline
Light Poster

Re: Please help!!! Winsock2/Sockets with C++ Console app?

 
0
  #6
Dec 6th, 2008
No Windows API is different. Console applications are the DOS window.
Last edited by amerninja2; Dec 6th, 2008 at 3:15 pm.
Reply With Quote Quick reply to this message  
Join Date: Aug 2005
Posts: 15,359
Reputation: Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute 
Solved Threads: 1464
Team Colleague
Featured Poster
Ancient Dragon's Avatar
Ancient Dragon Ancient Dragon is offline Offline
Still Learning

Re: Please help!!! Winsock2/Sockets with C++ Console app?

 
0
  #7
Dec 6th, 2008
winsock IS part of win32 api. If you are looking for more complex client/server console code then you can find it by downloading the library here

>>No Windows API is different. Console applications are the DOS window.
You don't have to write a windows program to implement some win32 api functions.
Last edited by Ancient Dragon; Dec 6th, 2008 at 3:23 pm.
Don't PM me with questions -- you might get a nasty PM in response. If you have a question then post it in one of the forums.
Reply With Quote Quick reply to this message  
Join Date: Oct 2008
Posts: 36
Reputation: amerninja2 has a little shameless behaviour in the past 
Solved Threads: 0
amerninja2 amerninja2 is offline Offline
Light Poster

Re: Please help!!! Winsock2/Sockets with C++ Console app?

 
0
  #8
Dec 6th, 2008
What about Unix Sockets. It says to run on Windows theres things in it that you have to change/add, but will a C++ DOS Console app run normal unix sockets under windows normally without the changes?
Reply With Quote Quick reply to this message  
Join Date: Oct 2008
Posts: 36
Reputation: amerninja2 has a little shameless behaviour in the past 
Solved Threads: 0
amerninja2 amerninja2 is offline Offline
Light Poster

Re: Please help!!! Winsock2/Sockets with C++ Console app?

 
0
  #9
Dec 6th, 2008
Oh, so can I use the Console lib under a windows app, and then use sockets with that? Or is my other comment I just replyed with true?
Reply With Quote Quick reply to this message  
Join Date: Apr 2008
Posts: 670
Reputation: Freaky_Chris is a jewel in the rough Freaky_Chris is a jewel in the rough Freaky_Chris is a jewel in the rough 
Solved Threads: 113
Freaky_Chris's Avatar
Freaky_Chris Freaky_Chris is offline Offline
Practically a Master Poster

Re: Please help!!! Winsock2/Sockets with C++ Console app?

 
0
  #10
Dec 6th, 2008
DOS != UNIX therefore they are different. Therefor they need different sockets. *Win*sock is the windows socket libraries, implemented with Win32 API calls, which CAn be used with DOS console applications but NOT unix.

Chris
Knowledge is power -- But experience is everything
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Other Threads in the C++ Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC