Python Networking In Hindi

Networking In Hindi – Python Networking In Hindi

Python

Python Networking In Hindi :- Python Networking Programming Ek Aavashyak Bhomika Nibhata Hai | Python Networking ko Istemal Karne ke Liye Alag Se Module Teyar Kiye Gaye Hai | Networking Mai Python Protocol ,Encoding and decoding ko full support karta hai |

Also Read :- A to Z Python Tkinter Tutorial

Python Hacking Tutorial

Python Networking In Hindi

Network Services Ko Access Karne Ke Liye Python Two Levels Provides Karta Hai.

  • 1 . Low Level :- Aap Operating System Mai Socket Support Ko Access Kar Sakte Hai |
  • 2 . High Level :- Python Networking Mai Higher level Access Karne Ke Liye Python Libraries ya module provides karta hai Jaise Ki :- FTP, HTTP And Etc.

Ham Is Post Mai A to Z Python Networking Ke Concept Ko Understand Karne Wale Hai |

Python Sockets In Hindi

Python Networking In Hindi

What is Sockets In Hindi ?

Aapko Ye To Jarur Pta Hoga Ki Internet Par Bahut Sare Computers Ek Sath Aapas Mai TCP/IP Protocol Duvara Connected Rahte Hai | Socket Keval Ek Abstraction Hota Hai | Jo 2 Computers Ke Bich Ke Connection ke terminal ko Represent Karta Hai | Ye TCP/IP Network mai Ek Connection Point Ko Represent Karta Hai | Kisi Diye Gaye Connection Mai Har Computer Par Ek Socket Hota Hai Or Ham Ye Man Sakte Hai Ki Dono Computers Ke Bich Ek Virtual Network Ya Cable Hoti Hai , Jisse Dono Computers Ke Sockets Aapas Mai Connect Hote Hai |

Defining Socket :- Socket Interface Mai Jab 2 Computers Aapas Mai Communication karna Chahte Hai | Tab Dono Computers ek socket ka istemal karte hai | Dono Computers mai Se Kisi Ek Computer Ko Server Banaya Jata Hai , Joki Ek Socket ko Open Karta Hai Or Connection ke liye Wait Karta Hai | Yani Kisi Client Ke Connection ko Lister Karta Hai |

Sockets in Hindi have their own vocabulary −

  • Domain Name Servers (DNS)
  • IP addressing
  • E-mail
  • FTP (File Transfer Protocol) etc…
s = socket.socket (socket_family, socket_type, protocol=0)

Niche Diye Gye parameters ke description Hai −

  • socket_family − Yah ya to AF_UNIX or AF_INET |,
  • socket_type − Yah ya to SOCK_STREAM or SOCK_DGRAM.
  • protocol − Jyada tar Isse chod diya jata hai, Wese Iski Defult Value 0 Hai.

Server Socket Methods In Hindi

Sr.No.Method & Description
1s.bind() :- Yah Method Ko Bind Yani Ek Sath Add Karta Hai Socket Se – (hostname, port number pair) .
2s.listen() :- Yah Method Setup Or Start Karta Hai TCP listener ko.
3s.accept() :- Yah Connection Aane Tak Wait Karta Hai or Jab Connection Aa Jata Hai To Ye Accept Kar Leta Hai |

Client Socket Methods In Hindi

Sr.No.Method & Description
1s.connect() :- Yah Method Accept Hote Hi TCP server Se connection Bana Leta Hai |

General Socket Methods In Hindi

Sr.No.Method & Description
1s.recv() :- Yah Method TCP Message Ko Receives karta Hai.
2s.send() :- Yah Method TCP message Ko transmits karta hai.
3s.recvfrom() :- Yah Method UDP message ko receives Karta Hai.
4s.sendto() :- Yah Method UDP message Ko transmits karta hai.
5s.close() :- Yah Method Socket Ko Close Karta Hai.
6socket.gethostname() :- Yah Method Hostname Returns Karta Hai |

Create Simple Server In Python

Ab Tak Hamne Theory Ko Cover Kiya Ab Ham Server.py Create Karne Wale Step By Step |

Step 1 . Sabse Pahle Ham Socket Ko Import karte Hai |

import socket

Step 2. Ab Ham Socket Ka Object Create Karte Hai |

import socket 
s = socket.socket() # Create a socket object

Step 3. Ab Ham local machine Ka name Lete Hai Or Port Number Bhi Dete Hai |

import socket 
s = socket.socket() # Create a socket object.
host = socket.gethostname()  # Get local machine name.
port = 12345                # Reserve a port for your service.

Step 4 . Ab Ham host or port ko bind function se bind karte hai |

import socket 
s = socket.socket() # Create a socket object.
host = socket.gethostname()  # Get local machine name.
port = 12345                # Reserve a port for your service.
s.bind((host,port))   # Bind to the port

Step 5. Ab Ham Listen function se program ko listen karte hai or connection connect hone ke liye loop teyar karte hai and bad mai connection ko close karte hai |

import socket 
s = socket.socket() # Create a socket object.
host = socket.gethostname()  # Get local machine name.
port = 12345                # Reserve a port for your service.
s.bind((host,port))   # Bind to the port
s.listen(5)                 # Now wait for client connection.
while True:
   c, addr = s.accept()     # Establish connection with client.
   print('Got connection from', addr)
   c.send('Thank you for connecting')
   c.close()                # Close the connection

Aap Upper Dekh Sakte Hai Hamne Ab Server Create Kar Liya Hai |

Create Simple Client In Python

Ab Tak Hamne Server Ko Create Kiya Ab Ham Client.py Create Karne Wale |

import socket               # Import socket module

s = socket.socket()         # Create a socket object
host = socket.gethostname() # Get local machine name
port = 12345                # Reserve a port for your service.

s.connect((host, port))
print s.recv(1024)
s.close()                     # Close the socket when done

Aap Upper Diye Gaye Client.py File Ko Dekh Kar Program Ko Understand kar Sakte Hai |

Ab Ham Jaise Hi Dono File Ko Run Karenge To Aapko Ye Output Milega |

Python Networking in hindi
Output

Networking In Hindi – Python Networking In Hindi

Agar Aap Python Networking Mai Master Hona Chahte Ho to Aap ye Book Buy Kar Sakte Hai Or Advance Python Networking Programming Mai Career Bana Sakte Hai | Par Ye Book English mai Available Hai

Also Read This Post:

Dosto mujhe ummed hai ki aap Networking In Python In Hindi ko acchi tarah se samanj gye honge agar aap ko ye post acchi lage to mere is website ko jarur follow kre or ha agar aap video bhi dekhna chahte hai to aap mere channel ko bhi subscribe kar sakte hai. channel ka link aapko home page par mil jayega |

Leave a Reply

Your email address will not be published. Required fields are marked *