Programming Forums

Programming Forums (http://www.programmingforums.org/forumindex.php)
-   C++ (http://www.programmingforums.org/forum15.html)
-   -   simple echo server (http://www.programmingforums.org/showthread.php?t=13407)

cwl157 Jun 21st, 2007 8:48 PM

simple echo server
 
I want to make a simple echo server to get started on c++ sockets in windows. The problem is all of the examples i've found on google I haven't been able to get to work because i'm always missing a library or their using something different from me or something to where it wont compile. I use devcpp and any help with getting started on sockets and making a simple echo server would be appreciated. Thanks.

Wizard1988 Jun 21st, 2007 9:29 PM

You should include winsock2.h and add libwsock32.a which you can find in Dev-Cpp/lib/. You can add it to the project from Project Options Parameters Add Library

cwl157 Jun 22nd, 2007 8:58 AM

ok so i have done that but now what do i do. I know there is a type called SOCKET is reading and writing the same as reading and writing to the screen but instead of cout and cin its something else? How do i read and write to the socket and connect to it. I did a little server in java where you started it and then to connect went to the ip of the machine and then entered a specific port thats specified in the server code. Does it work kind of the same way?

DaWei Jun 22nd, 2007 9:26 AM

Read Beej. It's *nix oriented but the basic concepts are the same, and it's easy to adapt to Winsock.


All times are GMT -5. The time now is 8:09 PM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC