• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 199
  • Last Modified:

appropriate design solution

Hi,

I need to have my server application communicate with a client application.  Here's the purpose:

Several client workstations on the local network have serial devices attached.  I have code to communicate with the serial device that must be run locally.  I need my server to send data to the client app, to send to the serial device.  The app running on clients is pretty lightweight, and doesn't require any UI - it needs to be controlled 100% from the server.  The server app is written in asp.net / c#.

I haven't done anything like this, so I'm not sure on the appropriate way to acheive this functionality.

Do I need to use ASP.NET Remoting?  Note: I'd prefer NOT to have IIS running on all the client workstations..So that rules out a webservice, right?  Any other ways of doing it?

Any suggestions are appreciated!

Thanks - Trevor
0
trevorhartman
Asked:
trevorhartman
  • 4
  • 3
1 Solution
 
raterusCommented:
Have you looked at using sockets?
http://www.c-sharpcorner.com/Network/SocketProgDTRP.asp

--Clueless
0
 
trevorhartmanAuthor Commented:
nope.  i'll check it out
0
 
trevorhartmanAuthor Commented:
are you familiar with windows services (i'm not)?  would that be appropriate?
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
raterusCommented:
I believe that would be a wise path to take, since the client app doesn't need to have a GUI, but probably always needs to be running.

You create a windows service that receives input from the server (using sockets) and talks to the serial port depending on what it receives.  Kind of like a puppet (see we can relate our jobs to our kids!)

--Michael

0
 
trevorhartmanAuthor Commented:
cool deal, after reading up on it, it sounds like the perfect solution! (at 21, no kids for me yet :)

-Trevor
0
 
raterusCommented:
*reading your profile*

just curious...how's this going?
0
 
trevorhartmanAuthor Commented:
great!

i got the windows service created, and made an installer in visual studio.net.  that made it very easy to deploy to the kiosk workstation.  the service runs in an infinite loop to accept TCP connections indifeinitely, like this:

while (true)
{
     // listen for connections

     // if we get one, acept
     {
           // accept the print string via StreamReader
           // open a serial port and send the string to the thermal printer
           // send back a success message via StreamWriter
     }

     // close connection
} // go back to listen for another connection

works very slick :)


the "client" side of the service (which is actually the asp.net server) goes like this:

Socket socketForServer = new TcpClient(kiosk, port); // kiosk is a string = DNS name or IP of the kiosk
// write print string via StreamWriter

and that's all there is too it really.... thanks for the suggestion, it worked better than i imagined
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 4
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now