0 Replies Latest reply on Jan 7, 2013 4:19 PM by Debra Hustis

    Socket Development - Best Practices

      I have inherited an older VB6 app using a Winsock API to talk to WinCE5.0 devices (MC9190 specifically). It looks like the easiest (easy being a very relative term at this juncture) way to convert this app to a .NET app is to migrate to a socket based enviornment. The current app is using a 3rd party CE client that talks to a VB6 based back end server. In this migration process, we will be writing our own CE client as well as using as much of the VB6 code as is practical. Since I am a novice at socket development, I have reviewed the EMDK for .NET 2.6 CaptureAccumulateTransfer sample application which seems to have the basis of the concept that I'd like to pursue. I have also searched the internet for other sample code for socket development and they all seem to be drastically different from each other and the moto sample, which tells me there are many ways to accomplish this. In my internet search I was looking for books, tutorials or other training aides, but seemed to only find sample code others have posted.

       

      While the CaptureAccumulateTransfer sample works, it is also very hard for a novice to follow and decifer the entry & exit points of the data being send & received. If anything this is going to be my biggest stumbling block in the near term. So what I'm looking for is a Best Practices guide, if one exists, on how to make this concept work in real life. The other option is to find those who have succeffuly implemnted this kind of project who can guide me.

       

      I'm sure I have a million questions but I'll start with a few 10,000 foot questions:

      1 - Is the CaptureAccumulateTransfer sample a good code base to develop an industrial strength system around? If not what is?

      2 - In this code base it seems as though the CE device opens a Socket connection to the host & the host connects to the device and the connection is kept open during the life of the app. My app will have many CE devices (up to 50) talking to a single server (which is a single code base). In socket development such as this does the device open a connection send some data, get a response, then close the socket?  Or are there 50 open simultaneous connections?

      3 - The current VB6 server app has a way to keep track of each of the devices (which I'm still trying to figure out). What is the best way to keep track of each device so that the Host only sends a response to the device that made the request?

       

      Thanks for any help you can provide.