单机斗地主单机_单击浏览器中的URL会发生什么

单机斗地主单机

In this article, I want my readers to get a picture of a very basic concept of the web world. Previously, I've written articles on the fancy stuff of today’s market, i.e. Angular journey, basics of react, etc. But, today, I want my readers to get into the journey which they encounter at first when they hit any URL.

在本文中,我希望我的读者对网络世界的一个非常基本的概念有所了解。 以前,我写过一些有关当今市场花哨的东西的文章,即Angular旅程React基础等。但是,今天,我希望我的读者进入他们遇到任何URL时首先遇到的旅程。

As the topic is self explanatory - when we hit any URL then what happens? - let’s start!

由于主题是不言自明的- 当我们点击任何URL时,会发生什么? - 开始吧!

Before discussing what happens after hitting the URL, we must go through what a URL actually is, and what different parts of the URL mean - right? Without wasting any time, let’s understand more about URLs.

在讨论点击URL后会发生什么之前,我们必须仔细了解URL的实际含义,以及URL的不同部分的含义-对吗? 不浪费时间,让我们更多地了解URL。

URL –统一资源定位符 (URL – Uniform Resource Locator)

If you look into its full form, then it is self explanatory: it has the location of the resources which we want to access. It is an address of the place where we want to go to interact with or find information.

如果您查看其完整形式,那将是不言而喻的:它具有我们要访问的资源的位置。 它是我们要与之交互或查找信息的地方地址

Let's look into your daily life. If you want to visit your friend’s house for some work or to get information, you need their address. The same thing goes here in this big web world: we have to give an address of the website which we want to access. The web site is like the house and the URL is the address.

让我们来看看您的日常生活。 如果您想访问朋友的房子进行工作或获取信息,则需要他们的地址。 在这个庞大的网络世界中,同样的事情发生了:我们必须提供要访问的网站的地址。 该网站就像房子,URL是地址。

网址剖析 (Anatomy of a URL)

Now, we know what a URL is but we still don’t know about the parts of a URL. Let’s go!

现在,我们知道什么是URL,但是我们仍然不知道URL的各个部分。 我们走吧!

Let’s take an example:

让我们举个例子:

https://www.example.com/page1

https://www.example.com/page1

Here, the first part is ‘https’. This basically tells the browser which protocol it should use. It can be http, https, ftp, etc. A protocol is a set of rules that browser use for communication over the network. 'https' is basically a secure version, i.e. information is exchanged in a secure way.

在这里,第一部分是'https' 。 这基本上告诉浏览器应该使用哪种协议。 它可以是http,https,ftp等。 协议是浏览器用于网络通信的一组规则“ https”基本上是一个安全版本 ,即,信息以安全方式进行交换。

The second part www.example.com is a domain name. You can relate it to your friend’s house. It is an address of website. We use it to reach to the server (trained computer) that is responsible for serving the information for that website. Wait! You might think, a seconds before I mentioned URL is the address whereas I also mentioned domain name is also address. You may have been confused. Don’t be confused!

第二部分www.example.com域名 。 您可以将其关联到您朋友的房子。 这是网站的地址。 我们使用它来访问服务器(受过培训的计算机),该服务器负责为该网站提供信息。 等待! 您可能会想,在我提到URL之前的一秒钟是地址,而我也提到域名也是地址。 您可能感到困惑。 不要困惑!

URL和域名之间的区别 (Difference between URL and Domain Name)

The major difference between both is that the URL is a complete address. URL tells about the method through which information should exchange, the path after reaching that website. Whereas the domain name is part of a URL.

两者之间的主要区别在于URL是完整地址 。 URL告知信息交换的方法,以及到达该网站后的路径。 域名是URL的一部分

Let’s take our previous example to better understand. You can say that your friend’s house address is a domain name, whereas the URL not only tells the friend’s house address (domain name) but also how you are going to communicate like talking in a separate room (secure) or in front of everyone (info can get leak). It also tells the path, i.e. at which part of the house you will go after entering into the house. Hence, the domain name is part of the URL. A domain name with more information is a URL.

让我们以前面的示例更好地理解。 您可以说朋友的住所地址是一个域名,而URL不仅告诉朋友的住所地址(域名),而且还告诉您如何交流,就像在单独的房间(安全)或在所有人面前说话(信息可能会泄漏)。 它还会告诉路径,即进入房屋后您将到达房屋的哪一部分。 因此,域名是URL的一部分。 具有更多信息的域名是URL。

I hope now you are clear with the URL. Let’s get into the next part.

希望现在您对URL有所了解。 让我们进入下一部分。

域名 (Domain Name )

In the previous part, I explained about domain names, but not in depth. I want you to go into it more. As I told you, the Domain name is the address of the website. It gives a unique identity to your website in such a huge web world. No two domain names can be the same BUT - Yes! There is ‘but’. This is not the only definition of a domain name. There is another story behind it. Let’s get into that story.

在上一部分中,我解释了域名,但没有深入介绍。 我希望您能进一步了解它。 就像我告诉你的那样,域名是网站的地址。 在如此庞大的网络世界中,它为您的网站赋予了独特的身份 。 但是两个域名不能相同-是的! 有“但是”。 这不是域名的唯一定义。 背后还有另一个故事。 让我们进入那个故事。

As we know, when we hit any URL or you can say domain name, then that website gets opened with its content. A server (a trained computer) serves it. We also know that every computer has an IP address which is used for communication over the internet. It is an address as its self explaining ‘IP address’. When we hit any URL, then we are actually hitting the IP address of the computer which is responsible for serving the website content (hosting).

众所周知,当我们点击任何URL或您可以说域名时,该网站就会随其内容一起打开。 服务器(训练有素的计算机)为它提供服务。 我们也知道每台计算机都有一个IP地址,该地址用于通过Internet进行通信。 它是一个地址,用于解释“ IP地址”。 当我们点击任何URL时,实际上是在点击负责提供网站内容(托管)的计算机的IP地址

But, now, you might think what the hell...is everything an address? Why does this domain name exist if the IP address is there? Why can’t we use IP address to get content of the website?

但是,现在,您可能会认为这到底是什么...一个地址? 如果IP地址存在,为什么这个域名存在? 为什么我们不能使用IP地址来获取网站内容?

Yes! You can use IP addresses to get content of the website but really!.. Would you be able to remember each website’s associated IP address? Obviously not! It’s hard to remember the IP address of every website. That’s why domain names came into the market.

是! 您可以使用IP地址获取网站的内容 ,但实际上是这样!..您能记住每个网站的关联IP地址吗? 显然不是! 很难 记住每个网站的IP地址 。 这就是域名进入市场的原因。

You can relate it to your contact list. You can’t remember every person’s number, but you can remember their name. Same concept applies here as well. You can’t remember those scary IP addresses, but you can easily remember domain names.

您可以将其关联到您的联系人列表。 您无法记住每个人的电话号码,但是您可以记住他们的名字。 同样的概念在这里也适用。 您不会记住那些可怕的IP地址 ,但是您可以轻松记住 域名

This huge amount of data is maintained in a database where the domain name with its IP address is stored. A system that stores domain names with its corresponding IP address is known as DNS (Domain name system) (I believe you must have heard about it).

大量数据保存在数据库中,该域名及其IP地址存储在数据库中。 存储带有相应IP地址的域名的系统称为DNS(域名系统) (我相信您一定已经听说过)。

I think I have discussed enough basics. Now, get a deep dive into the process of when we hit any URL.

我认为我已经讨论了足够的基础知识。 现在,深入了解何时点击任何URL的过程。

DNS查找以找到IP地址 (DNS lookup to find IP address)

After hitting the URL, the first thing that needs to happen is to resolve IP address associated with the domain name. DNS helps in resolving this. DNS is like a phone book and helps us to provide the IP address that is associated with the domain name just like our phone book gives a mobile number which is associated with the person’s name.

到达URL后,首先要做的是解析与域名关联的IP地址。 DNS有助于解决此问题。 DNS就像电话簿一样可以帮助我们提供与域名相关联的IP地址 ,就像我们的电话簿提供与该人的姓名相关联的移动电话号码一样。

This is the overview, but there are four layers through which this domain name query goes through. Let’s understand the steps:

这是概述,但是此域名查询通过四个层次 。 让我们了解这些步骤:

1. After hitting the URL, the browser cache is checked. As browser maintains its DNS records for some amount of time for the websites you have visited earlier. Hence, firstly, DNS query runs here to find the IP address associated with the domain name.

1.点击URL后,检查浏览器缓存 。 当浏览器为您之前访问的网站维护其DNS记录一段时间时。 因此,首先,DNS查询在此处运行以查找与域名关联的IP地址。

2. The second place where DNS query runs in OS cache followed by router cache.

2. DNS查询在OS缓存中运行的第二个位置,其次是路由器缓存

3. If in the above steps, a DNS query does not get resolved, then it takes the help of resolver server. Resolver server is nothing but your ISP (Internet service provider). The query is sent to ISP where DNS query runs in ISP cache.

3.如果在上述步骤中未解决DNS查询,则它将使用解析器服务器。 解析器服务器不过是您的ISP(Internet服务提供商)。 该查询将发送到ISP,在ISP缓存中运行DNS查询

4. If in 3rd steps as well, no results found, then request sends to top or root server of the DNS hierarchy. There it never happens that it says no results found, but actually it tells, from where this information you can get. If you are searching IP address of the top level domain (.com,.net,.Gov,. org). It tells the resolver server to search TLD server (Top level domain).

4.如果同样在第3步中未找到结果,则请求将发送到DNS层次结构的顶级或根服务器 。 它永远不会说没有找到结果,但是实际上它告诉您从何处可以获得这些信息。 如果要搜索顶级域的IP地址(.com,.net,.Gov,.org)。 它告诉解析器服务器搜索TLD服务器 (顶级域)。

5. Now, resolver asks TLD server to give IP address of our domain name. TLD stores address information of domain name. It tells the resolver to ask it to Authoritative Name server.

5.现在,解析器要求TLD服务器提供我们域名的IP地址。 TLD存储域名的地址信息。 它告诉解析器将其询问给权威名称服务器。

6. The authoritative name server is responsible for knowing everything about the domain name. Finally, resolver (ISP) gets the IP address associated with the domain name and sends it back to the browser.

6.权威名称服务器负责了解有关域名的所有信息。 最后,解析器(ISP)获得与域名关联的IP地址,并将其发送回浏览器。

After getting an IP address, resolver stores it in its cache so that next time, if the same query comes then it does not have to go to all these steps again. It can now provide IP address from their cache.

获取IP地址后,解析程序将其存储在其缓存中,这样,下次,如果出现相同的查询,则不必再次执行所有这些步骤。 现在,它可以从其缓存中提供IP地址。

This is all about the steps that is followed to resolve IP address that is associated with the domain name. Have a look below to better understand:

这就是解决与域名关联的IP地址所遵循的所有步骤。 请在下面查看以更好地了解:

通过浏览器启动与服务器的TCP连接 (TCP connection initiates with the server by Browser )

Once the IP address of the computer (where your website information is there) is found, it initiates connection with it. To communicate over the network, internet protocol is followed. TCP/IP is most common protocol. A connection is built between two using a process called ‘TCP 3-way handshake’. Let’s understand the process in brief:

一旦计算机(您的网站的信息是有)的IP地址找到 ,它开始与它连接 。 要通过网络进行通信,请遵循Internet协议TCP / IP是最常见的协议。 使用称为“ TCP 3向握手”的过程在两个之间建立连接。 让我们简单地了解一下过程:

1. A client computer sends a SYN message means, whether second computer is open for new connection or not.

客户端计算机发送SYN消息的方式,无论第二台计算机是否为新连接打开。

2. Then another computer, if open for new connection, it sends acknowledge message with SYN message as well.

2.然后, 另一台计算机 (如果打开以进行新连接)也会发送带有SYN消息的确认消息

3. After this, first computer receives its message and acknowledge by sending an ACK message.

3.之后, 第一台计算机接收其消息并通过发送 ACK消息进行确认

To better  understand, look below diagram.

为了更好地理解,请看下面的图表。

通信开始(请求响应过程) (Communication Starts (Request Response Process))

Finally, the connection is built between client and server. Now, they both can communicate with each other and share information. After successful connection, browser (client) sends a request to a server that I want this content. The server knows everything of what response it should send for every request. Hence, the server responds back. This response contains every information that you requested like web page, status-code, cache-control, etc. Now, the browser renders the content that has been requested.

最后,在客户端和服务器之间建立连接。 现在,他们可以彼此通信并共享信息。 成功建立连接后, 浏览器(客户端)服务器发送一个我需要此内容的请求 。 服务器知道它应针对每个请求发送什么响应的所有信息。 因此, 服务器做出响应。 该响应包含您请求的所有信息,例如网页,状态码,缓存控制等。现在,浏览器将呈现已请求的内容。

That’s it! All the above process happens when we hit any URL. Although this lengthy process takes less than seconds to complete. This is the answer to your question ‘what happens when we hit any URL in a browser?’

而已! 当我们点击任何URL时,以上所有过程都会发生。 尽管此冗长的过程只需不到几秒钟即可完成。 这是对您的问题“当我们在浏览器中点击任何URL时会发生什么?”的答案

Thanks for reading!

谢谢阅读!

翻译自: https://www.freecodecamp.org/news/what-happens-when-you-hit-url-in-your-browser/

单机斗地主单机

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
Unity3D是一款流行的游戏开发引擎,能够支持多种平台的游戏开发。单机斗地主源码就是利用Unity3D开发环境编写的一个斗地主游戏的代码。 单机斗地主源码主要包括游戏逻辑、UI设计和资源管理等方面的代码。游戏逻辑部分包括玩家操作、AI算法、牌的发牌和出牌规则等。玩家操作可以使用键盘、鼠标或触屏等方式进行,具体的交互方式可以根据需求进行修改。AI算法可以根据实际情况来实现不同难度的电脑智能,使游戏更具挑战性。牌的发牌和出牌规则需要根据斗地主的具体规则来编写,以保证游戏的准确性。 UI设计部分主要包括游戏界面的布局、按钮、文字和图像的显示等。可以使用Unity3D提供的GUI系统或UGUI系统来实现,通过调整和美化UI元素的样式和布局,可以使游戏界面更加美观和易于操作。 资源管理部分主要包括游戏所需的音频、图片和动画等。可以在Unity3D导入并管理这些资源,在需要时进行加载和卸载。可以使用音频资源实现游戏音效的播放,图片资源实现游戏界面的显示,动画资源实现游戏元素的动态效果。 Unity3D的单机斗地主源码具备灵活性和可扩展性,可以根据实际需求进行修改和完善。开发者可以根据自己的需求和技术水平,对源码进行二次开发,添加新的功能和玩法,以满足不同玩家的需求。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值