how to implement server client protocol using c - network-programming

I have a project to implement server client protocol in our lab. I want to explain my project as there would two or more host and one administrator. on administrator screen all the information about host computer which log in by host users would be displayed as a icons. on clicking on particular icon administrator can see the all information about system details like (log in history etc.), and administrator can access the host screen remotely or can handle mouse of host users.
thank you.

For working with sockets and client-server networking over TCP/IP, I recommend reading Beej's Guide to network Programming: http://beej.us/guide/bgnet/, free on the web.

Related

Linking online network server between software and application without web

I'm trying to make my network server online and link it to a system and an application that I designed. However I don't want to make a website to upload the server to. Is this possible? Can I link my server directly to my software and my application via the internet? Thanks.
You can connect to servers with out the world wide web.
Their is for example the Gropher protocol.
Most likely this is not what you are looking for.
If you want to reach your server from the outside you need a public IP address. Your internet provider has to give you one. You could get around this, if you know someone with a public IP who accepts to forward your traffic.

Sending Commands to a Remote Printer

I'm working on a web project in which I need to be able to communicate directly with my customer's printer. The customer uses my application through a browser, and would like to be able to click a button to print tickets uninterrupted, meaning there is no printer dialog popup from the browser. This requirement eliminates many traditional ways of sending information to the customer's printer, and because I want a solution that will work on any browser, solutions that use VBSCRIPT or other browser-dependent solutions will not work.
My initial solution for this problem was to create a Java applet that was loaded into the page dynamically when a "Print" button was clicked. However, browsers like Chrome and soon Firefox are removing support for NPAPI, which breaks my Java plugin.
The current solution I'm working on is to create a service in C# that the user installs locally on their machine, and then when the customer clicks the "Print" button, my server communicates with that service directly. This way I can bypass the browser restrictions, and the service running on the customer's machine will have full access to communicate with the target printer. The downside to this approach is that the user now has to install an additional bit of software on their machine, and for each machine they wish to access my application on and print from, that machine needs to have proper port-forwarding and firewall settings configured. I can make this work for my current customer, but with future customers it becomes a hassle. Furthermore, my new approach currently only supports Windows machines, and if future customers are using OS X or Linux, I will need to port the service.
Has anyone faced this problem before, or are there any ideas out there for how to communicate with a client's printer that is browser-independent?
There's no possible solution to this that both supports Chrome and doesn't require something to be installed on the machine; you can't run arbitrary code that interfaces with the OS from within Chrome. And the only way to interact with that other code besides a local web server would be Native Messaging in an extension, but that doesn't fulfill your cross-browser requirement.
you can't communication directly because of security. i also develop 1 application in c# for remotely printing.
there is one way if your client have remote printer then you can do this task easily make small app on server and integrate with all remote printer and you can execute printer command from server and print will comes from client printer

‘Allow service to interact with desktop’ option not available when configuring windows service with an account other than local system

Why the option ‘Allow service to interact with desktop’ is only available for Local System account and not for any other account while configuring a windows service from control panel? I want to configure the windows service so as to allow interaction with desktop irrespective of the account it is configured to run with. How to achieve it?
that is a good question! I have never seen an official explanation from Microsoft, but I would guess that the reason has to do with permissions and rights and not wanting to mislead users.
Not all users are created equal. Some do not have the rights to display a user interface on session 0, or interact fully with arbitrary programs (and resources) it is running alongside. Having those users able to show GUI elements from a service may lead to confusion. For example, if a user account having limited rights starts an instance of Windows Explorer as a service, that window may not be able to accept dropped files from a "regular" explorer started by the interactive user. This sort of thing may be very difficult to diagnose and explain!
Note that Windows can certainly do what you like and we code it all the time in our service applications (http://www.CoreTechnologies.com/). Windows is simply not making that option available to you for any arbitrary user.
Of course please please take a step back and beware changes in Vista. "Session 0 Isolation" is a game changer for interactive Windows Services!

how to restrict a web portal to a particular computer?

I am in the process of creating a Ruby on rails portal
This portal requires a lot of data feeding by the site owner's back-office personnel.
My client has this problem :
the office staff should not be able to access the back office interface from any other than his office computers
I have no idea how to achieve this. Is there a method for this?
Thanks in advance.
Edit:
Is tracking the Mac address a good solution.? is it possible if a ok?
I don't think that you should do anything in rails - this should be configured elsewhere. If rails is running on Apache then see mod_access.
The best way to set this up is to have the app hosted INSIDE the organisation's firewall. Best option - server lives inside the company on a subnet isolated entirely from direct internet access.
If you currently host outside the company, you can set up a firewall that prevents access from unknown IP addresses. You would only accept requests that come from the company's IP ranges. Ideally, you do this at the host/operating system level.
If that can't work, you can do add to your Rails authentication - detect the IP address of the request and if it is not in the company range, prevent access.
found a solution. Using a java applet one can access the machine's hardware details including MAC address. am using this idea.

How to tell ruby net libraries to use a particular network interface?

I'm doing some page scraping for a client and need to connect to their
vpn server. So I have the vpn client running on my linux box, and this
creates a new interface, say ppp0. Now, when I run Mechanize/open-uri,
etc. I need to be able to bind specifically to this particular
interface, because the other interfaces are to the internet in general.
How do I do this?
Thanks
If what you are connecting to over the VPN isn't also available over the open internet you shouldn't have to do anything and the internal TCP/IP networking stack should sort out the correct interface automatically.

Resources