Thread: [Dev-C++] Re: How to do WinSock programming
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: Ehi I. <eh...@ya...> - 2004-06-27 09:15:28
|
Hello Gs, Thanks David McKen for the reply. I appreciate it. But I gotta admit, I am a beginner programmer. Could any one give me a link to a tutorial on WinSock Programming. Thanks. dev...@li... wrote: Send Dev-cpp-users mailing list submissions to dev...@li... To subscribe or unsubscribe via the World Wide Web, visit https://lists.sourceforge.net/lists/listinfo/dev-cpp-users or, via email, send a message with subject or body 'help' to dev...@li... You can reach the person managing the list at dev...@li... When replying, please edit your Subject line so it is more specific than "Re: Contents of Dev-cpp-users digest..." Today's Topics: 1. Re: dev-cpp-4.9.9.0 (sp...@po...) 2. RE: file handling (Scott Simontis) 3. Re: How to do WinSock programming (David McKen) --__--__-- Message: 1 Date: Sat, 26 Jun 2004 10:40:55 -0400 From: "sp...@po..." To: dev...@li... Subject: Re: [Dev-C++] dev-cpp-4.9.9.0 Guillermo Gutierrez wrote: > /Any idea when the next version w/ the latest MinGW in the installer > will be available?/ > I'm in process of creating easy upgradeable mingw packages. I can also make an alpha 4.9.9.0 if you're interested (most likely sometime this weekend). Marek Januszewski --__--__-- Message: 2 From: "Scott Simontis" To: "'Marco Ribeiro'" , "'Eric'" Cc: Subject: RE: [Dev-C++] file handling Date: Sat, 26 Jun 2004 11:28:21 -0400 This might be a helpful link for some people: http://www.catb.org/~esr/faqs/smart-questions.html -----Original Message----- From: dev...@li... [mailto:dev...@li...] On Behalf Of Marco Ribeiro Sent: Wednesday, June 30, 2004 9:22 AM To: 'Eric' Cc: dev...@li... Subject: RE: [Dev-C++] file handling Sorry Eric, but I think the propose of this mailing list is not that. I mean, my idea of it is every one should try to help the way it's = possible. Well I have always two options: 1) Try to Help 2) See the mail and not help (even if I know the answer or at least a = clue for it) But the best part is this ;) You have two options too: 1) See the mail and go to the link 2) See the mail and discard ;)=20 Well but I understand your point, so here is the text you would find in = that page: NOTE: I DID A COPY PASTE OF THE PAGE, SOME LINES MIGHT BE IN DIFFERENT ORDER!!!!=20 Hope it helps...=20 C++ Notes: Reading Text Files Reading a text file is very easy using an ifstream (input file stream).=20 Include the necessary headers.=20 #include using namespace std; Declare an input file stream (ifstream) variable. For example,=20 ifstream inFile; Open the file stream. Path names in MS Windows use backslashes (\). = Because the backslash is also the string escape character, it must be doubled. = If the full path is not given, most systems will look in the directory that contains the object program. For example,=20 inFile.open("C:\\temp\\datafile.txt"); Check that the file was opened. For example, the open fails if the file doesn't exist, or if it can't be read because another program is writing = it. A failure can be detected with code like that below using the ! (logical not) operator:=20 if (!inFile) { cerr << "Unable to open file datafile.txt"; exit(1); // call system to stop } Read from the stream in the same way as cin. For example,=20 while (inFile >> x) { sum =3D sum + x; } Close the input stream. Closing is essential for output streams to be = sure all information has been written to the disk, but is also good practice = for input streams to release system resources and make the file available = for other programs that might need to write it.=20 inFile.close(); Example The following program reads integers from a file and prints their sum. = 1=20 2=20 3=20 4=20 5=20 6=20 7=20 8=20 9=20 10=20 11=20 12=20 13=20 14=20 15=20 16=20 17=20 18=20 19=20 20=20 21=20 22=20 23=20 24=20 25=20 26=20 27=20 // io/read-file-sum.cpp - Read integers from file and print sum. // Fred Swartz 2003-08-20 #include #include #include using namespace std; int main() { int sum =3D 0; int x; ifstream inFile; =20 inFile.open("test.txt"); if (!inFile) { cout << "Unable to open file"; exit(1); // terminate with error } =20 while (inFile >> x) { sum =3D sum + x; } =20 inFile.close(); cout << "Sum =3D " << sum << endl;=20 return 0; } The text from the above example can be selected, copied, and pasted into = an editor. =20 Copyleft 2000-3 Fred Swartz Last update 2003-09-25, URL=3Dundefined -----Original Message----- From: Eric [mailto:eri...@cl...]=20 Sent: s=E1bado, 26 de Junho de 2004 10:17 To: Marco Ribeiro; 'Noorez Kassam' Cc: dev...@li... Subject: Re: [Dev-C++] file handling COULD YOU NOT INCLUDE THE PAGE WITHIN THE EMAIL SOME PEOPLE LOG ON, GET THE EMAIL AND LOG OFF. IT IS VERY ANNOYING WHEN YOU "GO TO THIS URL TO FIND YOUR ANSWER" THANKS FROM ERIC ----- Original Message ----- From: "Marco Ribeiro" To: "'Noorez Kassam'" Cc: Sent: Wednesday, June 30, 2004 11:48 AM Subject: RE: [Dev-C++] file handling Sorry about the last post :) The link http://www.fredosaurus.com/notes-cpp/io/readtextfile.html bye. Marco -----Original Message----- From: dev...@li... [mailto:dev...@li...] On Behalf Of Noorez Kassam Sent: sexta-feira, 25 de Junho de 2004 22:09 To: dev...@li... Subject: [Dev-C++] file handling How can I get integers from a file. The get() method only seems to work with chars. _________________________________________________________________ STOP MORE SPAM with the MSN Premium and get 2 months FREE* http://join.msn.com/?pgmarket=3Den-ca&page=3Dbyoa/prem&xAPID=3D1994&DI=3D= 1034&SU =3Dhtt p://hotmail.com/enca&HL=3DMarket_MSNIS_Taglines ------------------------------------------------------- This SF.Net email sponsored by Black Hat Briefings & Training. Attend Black Hat Briefings & Training, Las Vegas July 24-29 - digital self defense, top technical experts, no vendor pitches, unmatched networking opportunities. Visit www.blackhat.com _______________________________________________ Dev-cpp-users mailing list Dev...@li... TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm https://lists.sourceforge.net/lists/listinfo/dev-cpp-users ------------------------------------------------------- This SF.Net email sponsored by Black Hat Briefings & Training. Attend Black Hat Briefings & Training, Las Vegas July 24-29 - digital self defense, top technical experts, no vendor pitches, unmatched networking opportunities. Visit www.blackhat.com _______________________________________________ Dev-cpp-users mailing list Dev...@li... TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm https://lists.sourceforge.net/lists/listinfo/dev-cpp-users --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.710 / Virus Database: 466 - Release Date: 23-Jun-04 ------------------------------------------------------- This SF.Net email sponsored by Black Hat Briefings & Training. Attend Black Hat Briefings & Training, Las Vegas July 24-29 -=20 digital self defense, top technical experts, no vendor pitches,=20 unmatched networking opportunities. Visit www.blackhat.com _______________________________________________ Dev-cpp-users mailing list Dev...@li... TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm https://lists.sourceforge.net/lists/listinfo/dev-cpp-users --__--__-- Message: 3 Date: Sat, 26 Jun 2004 17:41:32 -0400 From: David McKen To: "Mailing List, Dev-Cpp" Subject: Re: [Dev-C++] How to do WinSock programming Exactly the same. What changes is how you compile the program. Instead of adding WS2_32.LIB/WSOCK32.LIB you add -lws2_32/-lwsock32 to your linker command line. The includes, structures & functions all stay the same (the libraries also stay the same but they have slightly different file names) Ehi Ikhimiukor wrote: > Hi guys, > Can someone please tell me how to do WinSock programming with Dev C++? I > know Visual C++ syntax, but I am not sure of Dev C++'s syntax for doing > that kind of programming. Thanks. > > Ehi Ikhimiukor > > ------------------------------------------------------------------------ > Do you Yahoo!? > Yahoo! Mail > > - 50x more storage than other providers! --__--__-- _______________________________________________ Dev-cpp-users mailing list Dev...@li... TO UNSUBSCRIBE: http://www.noicys.cjb.net/devcpp/ub.htm https://lists.sourceforge.net/lists/listinfo/dev-cpp-users End of Dev-cpp-users Digest --------------------------------- Do you Yahoo!? Yahoo! Mail is new and improved - Check it out! |
|
From: A. K. <kli...@ad...> - 2004-06-27 11:20:53
|
Ehi Ikhimiukor wrote: > Hello Gs, > Thanks David McKen for the reply. I appreciate it. But I gotta admit, I > am a beginner programmer. Could any one give me a link to a tutorial on > WinSock Programming. Thanks. > http://www.ecst.csuchico.edu/~beej/guide/net/ http://tangentsoft.net/wskfaq/ Alex |
|
From: Gary L. <li...@lu...> - 2004-06-27 12:13:36
|
http://www.codeproject.com/internet/ Gary A. Klingenstein wrote: > Ehi Ikhimiukor wrote: > >> Hello Gs, >> Thanks David McKen for the reply. I appreciate it. But I gotta admit, >> I am a beginner programmer. Could any one give me a link to a tutorial >> on WinSock Programming. Thanks. >> > > http://www.ecst.csuchico.edu/~beej/guide/net/ > http://tangentsoft.net/wskfaq/ > > Alex > > > ------------------------------------------------------- > This SF.Net email sponsored by Black Hat Briefings & Training. > Attend Black Hat Briefings & Training, Las Vegas July 24-29 - digital > self defense, top technical experts, no vendor pitches, unmatched > networking opportunities. Visit www.blackhat.com > _______________________________________________ > Dev-cpp-users mailing list > Dev...@li... > TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm > https://lists.sourceforge.net/lists/listinfo/dev-cpp-users |
|
From: Jesse H. <jes...@gm...> - 2004-06-27 12:19:06
|
Quite a few helpful ones here: http://www.google.com/search?q=winsock+c%2B%2B+tutorial&sourceid=mozilla-search&start=0&start=0&ie=utf-8&oe=utf-8 On Sun, 27 Jun 2004 13:13:32 +0100, Gary Lawton <li...@lu...> wrote: > > http://www.codeproject.com/internet/ > > Gary > > > > A. Klingenstein wrote: > > > Ehi Ikhimiukor wrote: > > > >> Hello Gs, > >> Thanks David McKen for the reply. I appreciate it. But I gotta admit, > >> I am a beginner programmer. Could any one give me a link to a tutorial > >> on WinSock Programming. Thanks. > >> > > > > http://www.ecst.csuchico.edu/~beej/guide/net/ > > http://tangentsoft.net/wskfaq/ > > > > Alex > > > > > > ------------------------------------------------------- > > This SF.Net email sponsored by Black Hat Briefings & Training. > > Attend Black Hat Briefings & Training, Las Vegas July 24-29 - digital > > self defense, top technical experts, no vendor pitches, unmatched > > networking opportunities. Visit www.blackhat.com > > _______________________________________________ > > Dev-cpp-users mailing list > > Dev...@li... > > TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm > > https://lists.sourceforge.net/lists/listinfo/dev-cpp-users > > ------------------------------------------------------- > This SF.Net email sponsored by Black Hat Briefings & Training. > Attend Black Hat Briefings & Training, Las Vegas July 24-29 - > digital self defense, top technical experts, no vendor pitches, > unmatched networking opportunities. Visit www.blackhat.com > _______________________________________________ > Dev-cpp-users mailing list > Dev...@li... > TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm > https://lists.sourceforge.net/lists/listinfo/dev-cpp-users > -- Jesse Hallam University of Waterloo Freshman |
|
From: David M. <dml...@co...> - 2004-06-27 12:25:42
|
I would suggest the beej's guide to network programming (the first link from Alex) as he teaches not only winsock programming but general TCP/IP programming using the berkley sockets interface which works not only on windows but on just about every UNIX out there (i.e. you knowladge would go alot further). And just to add another tutorial to the mix check out: http://www.hal-pc.org/~johnnie2/winsock.html This is good for getting started but doesn't go into the more advanced stuff like looking up addresses, creating multi-threaded servers, etc. Hope this Helps David McKen Gary Lawton wrote: > http://www.codeproject.com/internet/ > > Gary > > A. Klingenstein wrote: > >> Ehi Ikhimiukor wrote: >> >>> Hello Gs, >>> Thanks David McKen for the reply. I appreciate it. But I gotta admit, >>> I am a beginner programmer. Could any one give me a link to a >>> tutorial on WinSock Programming. Thanks. >>> >> >> http://www.ecst.csuchico.edu/~beej/guide/net/ >> http://tangentsoft.net/wskfaq/ >> >> Alex >> |