socket是什么?(翻译)
根据stackoverflow的答案:
原文:A socket represents a single connection between two network applications. These two applications nominally run on different computers, but sockets can also be used for interprocess communication on a single computer. 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. Therefore a socket can be created theoretically at any level of the OSI model from 2 upwards. Programmers often use sockets in network programming, albeit indirectly. Programming libraries like Winsock hide many of the low-level details of socket programming. Sockets have been in widespread use since the early 1980s. A port represents an endpoint or "channel" for network communications. 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.mairie-metz.fr:8080/ In this example, the number 8080 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).
翻译:socket代表两个网络应用之间的单个连接。这两个应用通常运行在不同的电脑上,但socket也可以被用作一台电脑间不同进程间的通信。socket是双向的,这意味着连接的两边都可以发送和接受数据。这样,一个socket理论上可以在OSI模型的第二层以上的任意层建立。程序员常在网络编程中使用socket,尽管不是直接地使用。像Winsock这样的程序库隐藏了socket编程的许多底层细节。socket自从1980年代以来已经被广泛地使用。端口(port)代表端点(endpoint),通道(channel)代表网络通信。端口号允许一台电脑上的不同应用在不干涉彼此的前提下使用网络资源。端口号在网络中经常出现,特别是socket编程。虽然有时端口号对于临时用户是明显的。例如,用url访问如下网站时:
http://www.mairie-metz.fr:8080/
在这个例子中,数字8080表示被Web浏览器连接到Web服务器的端口号。一般来说,网站使用80端口,并且这个数字不需要被包括在url中(虽然也可以被包括)。
socket是什么?(翻译)的更多相关文章
- Socket为什么要翻译成套接字
作者:陈振玥链接:https://www.zhihu.com/question/21383903/answer/64103663来源:知乎著作权归作者所有,转载请联系作者获得授权. 作为一条刻(wu) ...
- 项目笔记---Socket Error Code翻译
前言 在项目中为了方便调试及客户反馈,需要Socket错误数字的中文解释,MSDN上只有英文版,同时也想自己学习而且方便将来更新ErrorCode的实际发生的情景,顾有此博文. MSDN:https: ...
- Socket编程(C语言实现):socket()函数英文翻译
最近开始研究使用Socket API来网络编程,想着把自己的感想.感悟写下来.我发现在编程之外还有不少概念性的东西要学习.我觉得应该有以下几点吧: 1.得了解下计算机网络的基本概念,如OSI的7层模型 ...
- python - socket - server
网络上关于socket的介绍文章数不胜数.自己记录下学习的点点滴滴.以供将来复习学习使用. socket中文的翻译是套接字,总感觉词不达意.简单的理解就是ip+port形成的一个管理单元.也是程序中应 ...
- 高性能Server---Reactor模型-----Socket
高性能Server---Reactor模型 原文地址:http://www.ivaneye.com/2016/07/23/iomodel.html 无处不在的C/S架构 在这个充斥着云的时代,我们 ...
- Socket套接字
socket编程,熟悉吧,那到底什么是socket呢?: 我们经常把socket翻译为套接字,socket是在应用层和传输层之间的一个抽象层,它把TCP/IP层复杂的操作抽象为几个简单的接口,来供应用 ...
- Java Socket网络编程学习笔记(一)
0.前言 其实大概半年前就已经看过网络编程Socket的知识了(传统IO),但是因为长时间的不使用导致忘的一干二净,最近正好准备校招,又重新看了网络编程这一章, 是传统IO(BIO)相关的内容,故在此 ...
- http中的socket是怎么一回事
首先我们先看一下socket的定义:是在传输层和应用层中间的一个抽象层,是实现网络通信的接口. 那么什么是传输层,什么是应用层呢?网络又是怎样通信的呢?为了弄清这两个问题,我们需要弄清一个概念TCP/ ...
- 【转】Python学习---Socket通信原理以及三次握手和四次挥手详解
[原文]https://www.toutiao.com/i6566024355082404365/ 什么是Socket? Socket的中文翻译过来就是"套接字".套接字是什么,我 ...
- Java Web 基础(一) 基于TCP的Socket网络编程
一.Socket简单介绍 Socket通信作为Java网络通讯的基础内容,集中了异常.I/O流模式等众多知识点.学习Socket通信,既能够了解真正的网络通讯原理,也能够增强对I/O流模式的理解. 1 ...
随机推荐
- thinkphp分页二,分装到funciton.php
function.php代码 <?php /* 全局分页 * $table 数据表名 * $order 排序 * $pagesize 每页显示N个 * $where 查询条件 * $rollPp ...
- Python之路【第十七篇】Django进阶篇
规范 确立规范的好处: 代码可读性高 方便代码的定位极其查找 为以后代码扩容带来便利 场景: 在多个APP的场景下,单个app的URL函数功能较多的时候,我们可以通过以下方法来解决. 把Views写成 ...
- PHP 图片上传
PHP上传的简单案例: Html文件: <html> <form action="index.php" name="form" method= ...
- @property 参数
/* 1.set方法内存管理相关的参数 * retain : release旧值,retain新值(适用于OC对象类型) * assign : 直接赋值(默认,适用于非OC对象类型) * copy : ...
- 【相当实用】如何让TortoiseSVN导出新增或修改过的文件
当一个网站项目进入运营维护阶段以后,不会再频繁地更新全部源文件到服务器,这个时间的修改大多是局部的,因此更新文件只需更新修改过的文件,其他没有修改过的文件就没有必要上载到服务器.但一个稍微上规模的网站 ...
- Linux C popen()函数详解
表头文件 #include<stdio.h> 定义函数 FILE * popen( const char * command,const char * type); 函数说明 popen( ...
- 7.1WebApi2的异常处理
这篇文章描述错误和异常处理在 ASP.NET Web API. HttpResponseException 如果 Web API 控制器引发未捕获的异常,会发生什么?默认情况下,大多数异常被转译为 H ...
- Add Two Numbers LeetCode Java
You are given two linked lists representing two non-negative numbers. The digits are stored in rever ...
- 【GWAS文献】基于GWAS与群体进化分析挖掘大豆相关基因
Resequencing 302 wild and cultivated accessions identifies genes related to domestication and improv ...
- JSON.stringify()和JSON.parse()
parse用于从一个字符串中解析出json对象,如 var str = '{"name":"huangxiaojian","age":&qu ...