Networking tidbits, Operating System

There is a very small amount of networking background required for Project 2. In Project 2, we want our computer (or our "host") to request information over the Internet from a remote webserver (another Internet "host"). On our computer, from within our Project 2 ap-plication, we will open a "socket", which on many operating systems acts like a ?le which you can read or write. Moving down the network stack into the operating system, a socket uses a transport protocol to communicate with the remote host. The application-layer HTTP protocol which webservers use is built on top of the transport-layer TCP protocol, which provides reliable, in-order, stream-based delivery between your socket and the remote socket. A socket also has a "port" number associated with it. When we open our socket, we will request that it opens port 80 on the remote host, since this is the port number on which almost all webservers listen for re-quests.  Finally, when opening the socket, we need to specify which remote webserver we want to communicate with, such as, etc. Moving down one more layer, every host (laptop, server, cell phone, etc) which is directly accessible on the Internet has a unique network-layer IP address, such as, and most of those have hostnames, such as; the Domain Name Service (DNS) translates from hostnames to IP addresses.

Note that the method is in a while-loop, since reading from a socket will return between one byte and the maximum number of bytes requested ((MAX READ-1-size) in the code above). You'll need to keep repeatedly reading from the socket again until you get all the bytes you want. will block until it has at least one byte to return, unless its request times out (set by sock.setTimeout(5) to be 5 seconds), or unless the connection is closed.

Posted Date: 3/12/2013 5:20:42 AM | Location : United States

Related Discussions:- Networking tidbits, Assignment Help, Ask Question on Networking tidbits, Get Answer, Expert's Help, Networking tidbits Discussions

Write discussion on Networking tidbits
Your posts are moderated
Related Questions
Characteristics of suspend process Suspended process isn't immediately available for execution. The process may or may not be waiting on an event. For preventing t

Define seek time and latency time. The time taken by the head to move to the appropriate cylinder or track is known as seek time. Once the head is at right track, it must wait

Explain external fragmentation? External fragmentation is the process where the free space and the space still available for use, in a piece of storage become separated into ma

UNIX Shell and History feature. 1.Creating a child process. 2.Creating a history feature. With the notes under code. Its exactly "programming project 1 - Unix Shell and History Fea

Define a public key encryption system Allows just the correct receiver to decode the data

why we say " OS is a resource allocator" and “OS is a control program"?

List operations to be performed on directories. Search for a file, delete a file, create a file, list a directory, rename a file, and traverse the file system.

Give a brief introduction about the operation of your program and show that you understand the idea behind threads and mutual exclusion variable. Why do we need to use mutual exclu