CrazyEngineers Archive
Old, but evergreen and popular discussions on CrazyEngineers, presented to you in read-only mode.
@computeridiot007 • 06 Jul, 2010
Most of my questions are still didn't answered.Anyway this is my another query brothers
I hope you will make it clear.
how application software interact with system software.
I have some point of view .Is it correct.
"whenever an application software is launched it uses its corresponding port nos to interact with system software(operating system which will act like a socket).But I often get a confusion if this is the case so many tons of softwares are there then how they will manage port nos.Also what happens in case of various os scenarios like in windows,linux,macintosh".
Anyway advanced thanks before answering my question
@gaurav.bhorkar • 07 Jul, 2010 From what I've learned so far, recent operating systems communicate with their software programs with what is called as 'event'. In MS Windows, these events are called as 'Messages'. In Linux, these are called as 'Signals'.

So these events are nothing but messages to communicate. Lets take Windows OS, every application has an Application Message queue. If you open window and press the X on top right hand side to close it. Thus you are making an event to occur, by clicking the X button. As soon as you click X, a message (Known as WM_QUIT) is passed in the Application message queue to the OS. The OS in turn closes the specific window in whose message queue the message WM_QUIT is present.

I hope you get it now.
@computeridiot007 • 07 Jul, 2010
gaurav.bhorkar
From what I've learned so far, recent operating systems communicate with their software programs with what is called as 'event'. In MS Windows, these events are called as 'Messages'. In Linux, these are called as 'Signals'.

So these events are nothing but messages to communicate. Lets take Windows OS, every application has an Application Message queue. If you open window and press the X on top right hand side to close it. Thus you are making an event to occur, by clicking the X button. As soon as you click X, a message (Known as WM_QUIT) is passed in the Application message queue to the OS. The OS in turn closes the specific window in whose message queue the message WM_QUIT is present.

I hope you get it now.
bro thanks for your reply this thing I know already.This thing comes under windows and visual programming concepts.I am asking whether while they communicate like in network (socket (os) and the port will be used by the application )in order to establish the connection.
Anyway i am glad that you responded quickly.
@gaurav.bhorkar • 07 Jul, 2010
computeridiot007
bro thanks for your reply this thing I know already.This thing comes under windows and visual programming concepts.I am asking whether while they communicate like in network (socket (os) and the port will be used by the application )in order to establish the connection.
Anyway i am glad that you responded quickly.
hmm...Well, I don't have any idea about the use of 'port nos.' in communicating of software with the OS. Waiting for other CEans to answer.
@Manish Goyal • 07 Jul, 2010 well I don't think so there is any role socket ,port no's in interaction of system software with application software

It involves a lot of processes which communicate with each other via interprocess communication

Correct me if i am wrong
@computeridiot007 • 07 Jul, 2010
goyal420
well I don't think so there is any role socket ,port no's in interaction of system software with application software

It involves a lot of processes which communicate with each other via interprocess communication

Correct me if i am wrong
brother then why every application is having a port nos
@Manish Goyal • 07 Jul, 2010 Port no are just used to connect your computer with some remote computer.A particular application just listen on a particular port .
calculator is also a kind of application software. It has not any port no
@Morningdot Hablu • 07 Jul, 2010 look
when any application need to talk with other application they must need a port number.
computer gives the port number ranging from 00 to 65000(in approx).
every application have a unique port number.Because once a port number is given to an application it cannot be given to others.

computeridiot007
brother then why every application is having a port nos
when one application want to communicate with other application.They must know where it is.

IP address of the machine(where the application is running) and the port number these two things makes the unique address of an application.
collectively these two are known as socket.
you can say that a port number determine the uniqueness of an application.

when any system software executes the application software.
Than application software make a call to system software for the resources to perform any operation on files or send a message(Tcp/ip).

let me know if you have any more doubt about this.
@Morningdot Hablu • 07 Jul, 2010 But i don't know how to find which application software using which port no.
Anybody have idea about that.
@Manish Goyal • 07 Jul, 2010 You mean to say one application communicate with another on same machine via socket?
@Morningdot Hablu • 08 Jul, 2010
goyal420
You mean to say one application communicate with another on same machine via socket?
socket is the unix/linux method for accomplishing inter-process communication (IPC). What this means is as a commonly used analogy is that a socket is used to allow one process to speak to another. The socket is a programming interface that is used to open communication pathways between two or more generally different processes.

These processes are usually, but not necessarily running on different computers. If two processes wish to communicate either on the same machine or on different computers they can’t call functions within each other like objects within a program so they need some common reference point. If they were on the same machine they could both write to a file on the hard disk, this requires both having pre-agreed a ‘physical’ file and would be slow.

Instead of this they communicate either between the operating systems on two machines or within the operating system of a single machine.
Sockets are the common point of reference the processes require managed by the operating system. The program tells the operating system by a function call that it wants to listen to a specific socket identified by an integer.

Whenever another program writes information to that socket the operating system checks the listeners of the given descriptor. Effectively the socket is a centralised way of communication between applications controlled by the operating system.

hope you got your answer.
4.4k views

Related Posts

@Jason Estibeiro · Mar 11, 2015

After the success of HTC Desire 816G and Desire 826 which were released two months ago, HTC may have decided to go ahead with the launch of Desire 820s in...
3.8k views

@bhargav khanpara · Oct 15, 2013

WHY SOMETIMES WE GIVING CHOCK TO VEHICLE
12.2k views

@kashmirihasan · Oct 4, 2010

Hello, This is Kashmiri from Lahore and I want to know the difference between alternator and generator. Any one who could reply??? I really want to know the answer.
9.4k views

@Mahesindai · Jul 5, 2012

hello friends... we are using turbo charges in buses and in lorry and trucks why can't we use turbo charger in bikes it use to increase efficiency know ??
8.2k views

@Raagavan Sivaraja · Jan 10, 2016

Nikon gave shutterbugs a good time at the CES this year by announcing 3 top of the line cameras including Nikon D5,which is the sequel to its already popular D4....
10.6k views