How do I make an app that functions as a "server"

bonedoc

Well-known member
Joined
May 4, 2006
Messages
112
Programming Experience
Beginner
If I am on the computer at work. At home, I have a picture located at:

C:\Picture1.jpg

How can I access this from work? Basically, how can I use my home computer as a server to transfer a file to work if I type the path for the image in? I have created instant messenger servers and downloaded files on the net. But, I am clueless on where to start here. How can I it to allow access a file through a port? The app on my computer I will be downloading from will always be running.
 
Not familiar with "instant messenger servers" but you need some kind of server software for sure, normally done with a webserver like IIS or a FTP server. You can also create a simple socket server yourself with for example TcpListener and connect to it with TcpClient, both to be found in System.Net.Sockets namespace. You need to know the public IP of the home computer, for example by buying static IP from your Internet Service Provider or using a dynamic IP service. The server computer also needs to be connected to internet at all times, not only 'able to connect' at all times. This is a gotcha by some broadband providers that they will disconnect you on idle time, even if it feels like you are online all the time you're actually not and consequently not publicly available from the internet and can't run server software. Some ISPs also forbid regular home customers to set up servers on the account unless you pay for a professional level account. Finally any firewalls must be open on the incomming port and home router if any must do port forwarding from the public IP held by the router to the local IP to handle the request. Bet you didn't know what you were diving into.. :)

Even if you know what you're doing you are in most cases better off getting an account at a professional server provider for your internet server needs. There also exist some free or not expensive options here for webserver homepages (often included by the home internet account) including FTP and various online storage facilities that you can use. For example upload from home computer even automated or time schedule upload to the internet storage account and just get it from that place instead when you need it from work.
 
Back
Top