954,483 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Best Winsock programming practice

I started learning Winsock (2.2) programming in university recently and when writing my first program (fileserver and its client) a few questions came to mind. Let`s assume my fileserver is continuously listening for client connections and when one occurs it establishes connection, does whatever client wants (such things as list directory contents, file upload or download, etc) then closes connection and again, listens for new incoming connections. Client waits for user input and connects to the server ONLY after receiving it. So, is this kind of thing right? Maybe the connection between client and server should not be terminated after each command but instead exist as long as client is open in remote computer. This way accept() and disconnect() would only be called once and things may speed up a bit. I don`t know if there is a way to keep "empty" connection alive, though.

Any thoughts? :)

Varnius
Newbie Poster
20 posts since Aug 2010
Reputation Points: 12
Solved Threads: 5
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: