12 Replies - 611 Views - Last Post: 12 July 2011 - 04:00 PM Rate Topic: -----

#1 RollaJ  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 12
  • Joined: 11-July 11

How to move code online.

Posted 11 July 2011 - 01:22 PM

I've been sitting here trying to work out how to phrase what I need help with for a while and I think I've put together an example of what I'm trying to achieve but in doing so I'm beginning to think that the problem isn't with c# but my lack of knowledge about how things online work.

So my example is as follows (please keep in mind this isn't exactly what I am trying to do but just an example of what I am trying to achieve so please don't try and suggest different solutions/ways of doing it unless I've got it totally wrong).

I currently have a 2 programs and a database I have written in C# and MSSQL respectively, the programs are a server and a client.
The server runs (as long as the PC is on obviously) and the client (up to 4 instances of) connect to it, grab what it needs and disconnects every 15 minutes. The server is always doing something, ranging from simple scheduled calculations to just counting time since last connection. Both have access to the MSSQL database. This works perfectly locally.

I now want to move the server and database online (rather then just PCs on the local network), but the clients are obviously still on a users PC.

So far I have successfully created a MSSQL database on some web space, linked the client and server to it and can happily manipulate it. What I'm having issues with is I cant understand how to get my server program "online" so to speak. So its running on a server thats up 24/7 instead of my PC.

Some basics about me and my situation, I am a competent c# programmer (with dabbling in a number of other languages) but by no means a pro, I use VS2010 (full) for doing everything but not against using anything else if would help. My current networking code between client and server uses sockets. I have no experience coding with online in mind and have always worked locally so my understanding is limited but I learn fast, I just don't know where to look or how to approach this at all.

Is This A Good Question/Topic? 0
  • +

Replies To: How to move code online.

#2 eclipsed4utoo  Icon User is offline

  • Not Your Ordinary Programmer
  • member icon

Reputation: 1526
  • View blog
  • Posts: 5,961
  • Joined: 21-March 08

Re: How to move code online.

Posted 11 July 2011 - 02:11 PM

So what is the actual question? How to make it the server application run all the time?
Was This Post Helpful? 0
  • +
  • -

#3 RollaJ  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 12
  • Joined: 11-July 11

Re: How to move code online.

Posted 11 July 2011 - 02:16 PM

View Posteclipsed4utoo, on 11 July 2011 - 02:11 PM, said:

So what is the actual question? How to make it the server application run all the time?


Sorry, yes the problem I'm having is getting my head around how to get the server online and running all the time.
Was This Post Helpful? 0
  • +
  • -

#4 eclipsed4utoo  Icon User is offline

  • Not Your Ordinary Programmer
  • member icon

Reputation: 1526
  • View blog
  • Posts: 5,961
  • Joined: 21-March 08

Re: How to move code online.

Posted 11 July 2011 - 02:19 PM

View PostRollaJ, on 11 July 2011 - 05:16 PM, said:

View Posteclipsed4utoo, on 11 July 2011 - 02:11 PM, said:

So what is the actual question? How to make it the server application run all the time?


Sorry, yes the problem I'm having is getting my head around how to get the server online and running all the time.


You could do it as a windows service. This would mean that a user isn't required to be logged into the server.
Was This Post Helpful? 0
  • +
  • -

#5 SurfingShark  Icon User is offline

  • D.I.C Head

Reputation: 38
  • View blog
  • Posts: 188
  • Joined: 18-April 11

Re: How to move code online.

Posted 11 July 2011 - 04:02 PM

Quote

What I'm having issues with is I cant understand how to get my server program "online" so to speak. So its running on a server thats up 24/7 instead of my PC.


I guess I'm missing the point. Currently, you have a separate PC running your server version application. Do you want to migrate that software to an actual web server (or an actual Windows Server machine dedicated to server functionality) to fulfill the server requirement, or just have it on your local pc still??
Was This Post Helpful? 0
  • +
  • -

#6 Curtis Rutland  Icon User is offline

  • (╯□)╯︵ (~ .o.)~
  • member icon


Reputation: 4559
  • View blog
  • Posts: 7,980
  • Joined: 08-June 10

Re: How to move code online.

Posted 11 July 2011 - 09:36 PM

I know you didn't ask for different possible solutions, but I might have a better suggesting (with the limited info you provided, I could be off base).

First of all, I don't like the idea of a DB exposed to external access on a server. That's a massive surface for attack. I prefer not to allow DBs on my external servers to support remote connections. I have the "server" program act as a data access vehicle. Clients make requests to it, and it reads/writes the DB.

Second, this might be able to be implemented as a web application, or web service (WCF). That will save a lot of hassle with direct TCP connections.
Was This Post Helpful? 1
  • +
  • -

#7 RollaJ  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 12
  • Joined: 11-July 11

Re: How to move code online.

Posted 11 July 2011 - 11:32 PM

Thanks for the replies!

View PostSurfingShark, on 11 July 2011 - 04:02 PM, said:

Quote

What I'm having issues with is I cant understand how to get my server program "online" so to speak. So its running on a server thats up 24/7 instead of my PC.


I guess I'm missing the point. Currently, you have a separate PC running your server version application. Do you want to migrate that software to an actual web server (or an actual Windows Server machine dedicated to server functionality) to fulfill the server requirement, or just have it on your local pc still??


This is the problem that I'm trying to get across! Ideally a web server as I currently have a host for testing purposes, but is it even possible to put a C# App on web host? Or will I need a windows Server machine? Sorry if it seems like stupid a question, my web terminology and experience is incredibly poor!

View PostCurtis Rutland, on 11 July 2011 - 09:36 PM, said:

First of all, I don't like the idea of a DB exposed to external access on a server. That's a massive surface for attack. I prefer not to allow DBs on my external servers to support remote connections. I have the "server" program act as a data access vehicle. Clients make requests to it, and it reads/writes the DB..


This is a good idea and I'll defiantly take it on board.

View PostCurtis Rutland, on 11 July 2011 - 09:36 PM, said:

Second, this might be able to be implemented as a web application, or web service (WCF). That will save a lot of hassle with direct TCP connections.


Ok this is where my knowledge of things net fly out the window. How would this be achieved? Got any book suggestions? I'm not against learning new things in fact this is the point of me doing this.
Was This Post Helpful? 0
  • +
  • -

#8 RollaJ  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 12
  • Joined: 11-July 11

Re: How to move code online.

Posted 12 July 2011 - 03:02 AM

Sorry to double post but I've just found this in the forum.

http://www.dreaminco...rvices-in-c%23/

Is this what your suggesting? Learn ASP.net? If so great!
Was This Post Helpful? 0
  • +
  • -

#9 Curtis Rutland  Icon User is offline

  • (╯□)╯︵ (~ .o.)~
  • member icon


Reputation: 4559
  • View blog
  • Posts: 7,980
  • Joined: 08-June 10

Re: How to move code online.

Posted 12 July 2011 - 07:28 AM

Yes and no. It's a very good idea to learn ASP.NET (MVC, if you can, since it's better than web forms), but that tutorial is somewhat out of date. ASMX web services used to be an easy way to write web services, but WCF is the "new thing" since .NET 3.5. It's significantly deeper, and more complicated, but it's vastly more powerful. I suggest getting a book on WCF. This one, I'm told, is extremely comprehensive:

http://oreilly.com/c...g/9780596805494
Was This Post Helpful? 0
  • +
  • -

#10 T3hC13h  Icon User is offline

  • D.I.C Regular

Reputation: 65
  • View blog
  • Posts: 337
  • Joined: 05-February 08

Re: How to move code online.

Posted 12 July 2011 - 09:30 AM

If you were to give us an idea of what the server code is actually serving to the clients we would be in a better position to recommend a technology to bring it "online".
Was This Post Helpful? 1
  • +
  • -

#11 RollaJ  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 12
  • Joined: 11-July 11

Re: How to move code online.

Posted 12 July 2011 - 10:45 AM

View PostT3hC13h, on 12 July 2011 - 09:30 AM, said:

If you were to give us an idea of what the server code is actually serving to the clients we would be in a better position to recommend a technology to bring it "online".


Really not much more then the basics. Ints, strings, cha, bool. Would be handy to be able to send back objects but thats out of laziness rather then necessity. The server is doing calculations and live monitoring and the clients are basically monitors with a couple of actions they can authorise on the server.
Was This Post Helpful? 0
  • +
  • -

#12 T3hC13h  Icon User is offline

  • D.I.C Regular

Reputation: 65
  • View blog
  • Posts: 337
  • Joined: 05-February 08

Re: How to move code online.

Posted 12 July 2011 - 01:43 PM

What is your current communication method used by the clients when talking to the server?
Was This Post Helpful? 0
  • +
  • -

#13 JackOfAllTrades  Icon User is offline

  • Saucy!
  • member icon

Reputation: 6092
  • View blog
  • Posts: 23,612
  • Joined: 23-August 08

Re: How to move code online.

Posted 12 July 2011 - 04:00 PM

I have the book Curtis Rutland mentioned, and I can vouch that it's a good one :)
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1