1. What are you working on, if I can ask?
I just started learning UNIX Network Programming a few months ago, say, about 2. I have been programming in the C language for a good 4 years. Though, sockets, and other functions are kind of new to me. I occasionally have a problem in my source code, as trivial as this one might I add. To answer this question, I'm just trying to make a test echo server. Though, I am adding a hash table to store and organize all the clients that connect. So I can look them up, remove them, add them, and other fun stuff. It's just to test my C ability.
2. Which of the two methods do you choose to use? I generally use the second just because it looks cleaner, though the first is more explicit.
I chose the first, as of now. Since I am passing a few other pointers, for instance integers, I wanted to keep the dereference style the same. Since none of the variables I pass are truely pointers, but rather memory addresses to local variables, I didn't want to get into a habit of using the pointer to struct shorthand (->) in this type of situation. I admit, the second method looks cleaner, though I am looking for more of an explict look.
I've been working on this project for some time now, though now I am developing it under the Linux environment. I've spent a while allowing executable options. And also able to read in a configuration file and parse it. Though, I spent the last few hours cleaning up all the compiler warnings and errors for GCC 3.4.3 since it's a bit more picky than usual, esp. with the -Wall
, and -std=c89
flags. Though, I managed to make the build perfectly clean. I am considering releasing the source code, but first I need to figure out why all connections never make it through to the server. No matter how many clients I write.
Hope this answers your questions,