1 Replies - 565 Views - Last Post: 14 January 2013 - 05:52 AM Rate Topic: -----

#1 itbec  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 14-January 13

Maintain state multiple concurrent sessions - not web

Posted 14 January 2013 - 04:38 AM

Hi All,

We are looking to update a VB6 based server application using C# and a flavour of VS2012 express. We are not .net developers and have very limited OO skills, hence our need for help.

Currently we have windows CE based mobile devices that connect to our VB6 server using transient sockets. The messages sent between client and server are strings. To allow multiple concurrent sessions that maintain state, we use an activex exe. This is the bit that we are struggling to understand how to replace.

We should be OK to muddle through the comms part by using a listener but we get stuck with the part after this. How do we simulate the actions of the activex exe which basically manages the transactional data of the devices in state and their own thread?

I should say we are looking for pointers in the right direction, not someone to code the solution for us it should be a good educational exercise for us.

Thanks for reading and any help appreciated.

Is This A Good Question/Topic? 0
  • +

Replies To: Maintain state multiple concurrent sessions - not web

#2 Skydiver  Icon User is offline

  • Code herder
  • member icon

Reputation: 6155
  • View blog
  • Posts: 21,226
  • Joined: 05-May 12

Re: Maintain state multiple concurrent sessions - not web

Posted 14 January 2013 - 05:52 AM

See the core of the while loop in the sample code for TcpListener:

Instead of doing all the work within the while loop, start up a new thread and accept the connection in the new thread. Also within that new thread, create a new instance of a class that represents the state of the communication with regards to that particular client.

This post has been edited by Skydiver: 14 January 2013 - 05:53 AM

Was This Post Helpful? 0
  • +
  • -

Page 1 of 1