Skip to main content

Connection Time out Vs Socket Time out

Time out
Any client(or source) which is unable to connect to the server (or Destination) in a specified time, then requests will automatically gets time outs.

Port
Port numbers allow different applications on the same computer to utilize network resources without interfering with each other. Port numbers most commonly appear in network programming, particularly socket programming. Sometimes, though, port numbers are made visible to the casual user. For example, some Web sites a person visits on the Internet use a URL like the following:

http://www.appdomain.in:80/ In this example, the number 80 refers to the port number used by the Web browser to connect to the Web server. Normally, a Web site uses port number 80 and this number need not be included with the URL (although it can be).

Port 80 is the default port for HTTP

Socket
Each and every communication from one application to another application should happen through sockets. Socket is gateway to send/receive information from one application to another.

A TCP socket is not a connection, it is the endpoint of a specific connection.
Every connection between a client and server requires a unique socket.
Applications can create multiple sockets for communicating with each other.
Sockets are bidirectional, meaning that either side of the connection is capable of both sending and receiving data

A socket contains following parameters

    An IP address
    A transport protocol
    A port number

A socket = Transport protocol + IP Address + a port (numeric address)   


   
Connection Time out Vs Socket Time out

Connection time outs will occur when requests are not able to reach remote machine on the specified
Host name/IP on specified port number under specified time.

So this Connection time outs can occur or can be simulated
1.By providing the incorrect host names or Port numbers.
2.By providing the time out period which is less than the actually it takes.
  This has to set at the code level while we creating the connection.

Socket time out will occur when requests are not able to reach the application which is running in local or remote machines.

So this socket time outs
1. By providing the time out period which is less than the requests actually takes.
2. Shut down the application which client is trying to connect.

Comments

Popular posts from this blog

Maven Build Life Cyles

Following are the maven build life cycles.

Clean - Removes the generated files in 'target' folder.

command : mvn clean

Validate - It validates your project and verify all the necessary information is there in project or not.

mvn  valiate

Compile - It compiles your project code.

mvn compile

Package - It takes the compiled code and packaged to JAR/WAR/EAR. It also compiles your code if your code is not compiled.

mvn package

Install -   It takes the packaged code and puts in your local maven repository (M2_HOME). It also does the compile and package if these are not already been done.

mvn install

Deploy - It takes the package and puts in remote repository for sharing accross team members or for other projects.

mvn deploy


FYI - Above commands can be used as variety of combinations.
e.g. mvn clean install
mvn clean package
mvn clean compile package install

To skip the tests to run 
mvn clean install -DskipTests



NO SQL Types and vendors in market

NO SQL

KEY - VALUE Store  - Similar to a  MAP.
   e.g. Dynamo DB or REDIS

DOCUMENT Sore  - Similar to KEY-VALUE, value can be JSON/XML and key will be unqiuely idnetified this document.
   e.g. Coutch DB or mongoDB.

Column Store - Multi timentional table, identifying data with row and column numbers.
  e.g.  Cassandra or Apache HBase

Graph Store - Store relation between nodes (record entities). It has better transaction management
e.g. Neo4J and Orient DB.