I've read Beej's guide to network programming and I'm trying to write an echoserver. So far, its just been frustration. I just can't get it to work. I just deleted all my code because I can't get farther than getting the socket descriptor. Can anyone just post echo server code? I promise this isn't a homework assignment.
EDIT: Please post the code so that its easy for me to understand. All in main() would be nice.
If you can't understand Beej, then programming just may not be your thing.