CN1099183C - 使用套接字函数的通信系统中的套接字绑定方法 - Google Patents

使用套接字函数的通信系统中的套接字绑定方法 Download PDF

Info

Publication number
CN1099183C
CN1099183C CN97122466A CN97122466A CN1099183C CN 1099183 C CN1099183 C CN 1099183C CN 97122466 A CN97122466 A CN 97122466A CN 97122466 A CN97122466 A CN 97122466A CN 1099183 C CN1099183 C CN 1099183C
Authority
CN
China
Prior art keywords
socket
server
time delay
bind
client computer
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Fee Related
Application number
CN97122466A
Other languages
English (en)
Other versions
CN1182240A (zh
Inventor
黄永吉
金秀炫
金鍾勋
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Samsung Electronics Co Ltd
Original Assignee
Samsung Electronics Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Samsung Electronics Co Ltd filed Critical Samsung Electronics Co Ltd
Publication of CN1182240A publication Critical patent/CN1182240A/zh
Application granted granted Critical
Publication of CN1099183C publication Critical patent/CN1099183C/zh
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/16Implementation or adaptation of Internet protocol [IP], of transmission control protocol [TCP] or of user datagram protocol [UDP]
    • H04L69/161Implementation details of TCP/IP or UDP/IP stack architecture; Specification of modified or new header fields
    • H04L69/162Implementation details of TCP/IP or UDP/IP stack architecture; Specification of modified or new header fields involving adaptations of sockets based mechanisms
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/30Definitions, standards or architectural aspects of layered protocol stacks
    • H04L69/32Architecture of open systems interconnection [OSI] 7-layer type protocol stacks, e.g. the interfaces between the data link level and the physical level
    • H04L69/322Intralayer communication protocols among peer entities or protocol data unit [PDU] definitions
    • H04L69/326Intralayer communication protocols among peer entities or protocol data unit [PDU] definitions in the transport layer [OSI layer 4]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/40Network security protocols
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/28Timers or timing mechanisms used in protocols
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Communication Control (AREA)
  • Computer And Data Communications (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)
  • Small-Scale Networks (AREA)

Abstract

一个计算机网络系统包括一个用于通过套接字函数建立在客户和服务器系统间通信的网络程序。如果通过用socket()函数建立系统间通信时导致‘bind()’系统调用失败,则‘bind()’系统调用将在一个预定的一小段时间之后被重新调用。这里的预定时间是一个基于关闭一个异常套接字的时间延迟而定的时间。

Description

使用套接字函数的通信系统 中的套接字绑定方法
技术领域
本发明涉及计算机中的系统间通信,特别涉及一种在网络计算机中使用套接字函数来建立通信的方法。
背景技术
为了在计算机网络中建立系统间通信,通常使用一种网络程序。网络程序用套接字函数分配套接字给每一个通信任务以建立通信。例如‘bind( )’系统调用常用于分配套接字。
参见图1,一个使用‘bind( )’系统调用的计算机网络系统包括一个服务器10和大量的连接到服务器10的客户机12。服务器10是一个独立的计算机系统,用于处理来自于客户机12的工作请求。客户机12也是一个独立的计算机系统,用于请求服务器10处理一个特定的工作。一个在服务器10和客户机12上都存在的网络程序管理服务器10和客户机12的系统间通信。为了建立服务器10和客户机12中的任一个客户机之间的通信,要用到网络程序中的套接字函数,并且一个套接字被分配给这个特定的通信任务。
当前用于分配套接字的方法,是通过在网络程序中使用套接字函数,如图2和3所示。图2和3分别用图来描述了使用面向连接协议,和无连接协议,通过‘bind( )’系统调用(在此后,引用为套接字绑定)分配套接字的过程。
参见图2,是关于使用面向连接协议的套接字绑定的过程,在步骤201和步骤211[socket( )],服务器10和客户机12分别指定了通信协议类型。在步骤202[bind( )],服务器10分配一个唯一的名字给一个未命名的套接字。在步骤203[listen( )],服务器10通知客户机12它已准备好接收一个来自于客户的连接,并在步骤204[auept( )],等待接受一个来自于客户机12的一个实际的连接。同时,在步骤212[connect( )],客户机12通过使用套接字描述符与服务器10建立了一个连接,并且在步骤213[write( )],通过socket( )指定的套接字描述符给出请求数据。在步骤205[read( )],服务器10通过socket( )指定的套接字描述符读出请求数据,之后根据数据请求执行处理过程。一但执行,在步骤206[write( )],服务器10根据处理执行的情况写回复数据。在步骤214[read( )],客户机12读取服务器10的回复数据。
下面参见图3,是关于使用无连接协议的套接字绑定的处理过程,在步骤301和311[socket( )],服务器10和客户机12分别指定了通信协议的类型。在步骤302和312[bind( )],服务器10和客户机12分别分配了一个唯一的名字给未命名的套接字。在步骤313[sendto( )],客户机12通过socket( )指定的套接字描述符发出请求数据。在步骤303[recvfrom( )],服务器10通过socket( )指定的套接字描述符接收到来自于客户机12的请求数据,并且在接收后,服务器10根据请求数据执行处理过程。此后,在步骤304[sendto( )],服务器10发出与请求数据相应的回复数据。在步骤314[recvfrom( )],客户机12收到来自于服务器10的回复数据。
如果在分配唯一名字给未命名的套接字的时候,‘bind( )’系统调用失败,则‘bind( )’系统调用将立即被重新调用。但是,如果‘bind( )’系统调用被反复的重新调用且继续失败,则会引起一个时间延迟,并且在这个时间延迟中将产生一个系统调用错误。当前的技术方法是在系统异常时反复重试系统调用。这种重试不需浪费系统资源,同时不会增加系统负荷。
发明内容
因此,本发明的一个目的是提供一种在使用套接字函数建立系统间通信时,当检测到不正常现象时,删除反复系统调用的方法。
本发明的另外一个目的是提供一种在使用套接字函数建立系统间通信时避免浪费系统资源的方法。
本发明还有一个目的是提供一种在使用套接字函数建立系统间通信时,防止增加系统负荷的方法。
根据本发明的一个所示实施例,用于使用套接字函数建立系统间通信的套接字绑定方法延迟了在‘bind( )’系统调用结果为失败时重新调用‘bind( )’系统调用的时间。重新调用的操作不是在失败之后立即执行,而是在一个预定的时间之后。这个预定时间基于已建立的系统用于关闭一个异常套接字的时间延迟。
附图说明
本发明的上述和其它目的,特性以及优点,将通过下面带有附图的示例实施例的详细描述变得更加明显:
图1是一个方框图,显示了一个通用计算机网络系统;
图2是一个根据当前技术使用面向连接协议的套接字绑定的方法的流程图;
图3是一个根据当前技术使用无连接协议的套接字绑定的方法的流程图;
图4是一个根据本发明的一个所示实施例的使用面向连接协议的套接字绑定的流程图;
图5是一个根据本发明的另一个所示实施例的使用无连接协议的套接字绑定的流程图。
具体实施方式
下面将通过参照附图详细描述本发明的一个实施例,在这些图中用相同的参考号表示相同的部件。进而,应该明白许多特性(例如详细的电路元件)是仅通过一个例子来说明的,以便更好地理解本发明,而没有这些特性本发明是可以实施的。此外,应该注意,如果确信对相关的当前技术的描述在描述本发明的概念时不是必需的,则这些详细描述会被人为地去除。技术要求中用到的短语是考虑到发明中的功能而定义的,并且它是根据通常的实践或用户或芯片设计者而可被替换的。建议短语的定义基于对特性的描述。
一种根据本发明的套接字绑定的方法将通过参照图4和5进行详细的描述,图4是一个使用面向连接协议的套接字绑定的实施例的流程图,图5是一个使用无连接协议的套接字绑定的实施例的流程图。套接字绑字方法的特性在于在‘bind( )’系统调用结果为失败时,重新调用‘bind( )’系统调用的操作不是立即执行,而是在一个预定的时间之后,这个预定的时间基于已建立的系统本身(例如,一个用于关闭异常套接字的时间延迟)。
参见图4,在步骤401和411[socket( )],服务器10和客户机12分别指定了通信协议的类型。在步骤402[bind( )],服务器10分配唯一的名字给未命名的套接字,并在步骤403检查‘bind( )’系统调用的结果是成功或是失败。如果‘bind( )’系统调用成功,则服务器10走到步骤405。否则,如果‘bind( )’系统调用失败,服务器10将在步骤404等待一个预定时间,之后将返回步骤402重新调用‘bind( )’系统调用。这里的预定时间是指系统自身的时间延迟,即关闭最初的不正常的套接字的时间延迟。
在步骤405[listen( )],服务器10通知它已准备好接受一个来自于客户机12的连接,并且在步骤406[accept( )],等待接收一个来自于客户机12的实际的连接。在步骤412[connect( )],客户机12通过套接字描述符建立与服务器10的一个连接,并在步骤413[write( )],通过由socket( )指定的套接字描述符写入请求数据。之后,在步骤407[read( )],服务器10通过由socket( )指定的套接字描述符读出请求数据,并根据请求数据执行处理过程。此后,在步骤408[write( )],服务器10根据执行的处理过程写入回复数据。在步骤414[read( )],客户机12读出来自于服务器10的回复数据。
参照图5,是关于一种使用无连接协议的套接字绑定的过程,在步骤501和511[socket( )],服务器10和客户机12分别指定了通信协议的类型。在步骤502和512[bind( )],服务器10和客户机12分别分配一个唯一名字给一个未命名的套接字。在步骤503和513,服务器10和客户机12各自检查‘bind( )’系统调用的结果是成功还是失败。如果‘bind( )’系统调用成功,则服务器10和客户机12将分别走到步骤505和515。否则,如果‘bind( )’系统调用失败,服务器10和客户机12分别走到步骤504和514,等待一个预定时间,此后分别返回步骤502和512,以重新执行‘bind( )’系统调用。这里,预定时间指系统自身的时间延迟,如前所述。
如果在步骤513‘bind( )’系统调用成功,那么在步骤515[sendto( )],客户机12将通过由socket( )指定的套接字描述符发出请求数据。进而,如果在步骤503‘bind( )’系统调用成功,在步骤505[recvfrom( )],服务器10将通过由socket( )指定的套接字描述符接收请求数据。服务器10接收到来自客户机12的请求数据之后,将根据请求数据执行处理过程。此后,在步骤506[sendto( )]服务器10发出与数据请求相应的回复数据。接着在步骤516[recvfrom( )],客户机12收到来自于服务器10的回复数据。
如前所述,当‘bind( )’系统调用失败时,‘bind( )’系统调用将在一小段预定时间之后被重新调用。因此,能够避免浪费系统资源和增加系统负荷。
虽然在上面详细的描述了本发明的优先实施例,但是要清楚的认识到这里讲到的许多在当前技术中可能出现的基本的发明的概念的更改和变化仍然包含在后面的权利要求中定义的本发明的实质和范围中。

Claims (8)

1.一种通过用套接字函数在计算机网络中建立系统间通信的分配套接字的方法,这种方法包括以下步骤:
在分配套接字过程中集成一个时间延迟,
激活一个时间延迟以响应失败的套接字分配;及
在该时间延迟之后重试套接字分配。
2.根据权利要求1的方法,其中上述时间延迟是基于系统关闭一个异常套接字的时间延迟确定的。
3.根据权利要求1的方法,其中上述集成,激活和重试的步骤是在面向连接协议系统中执行的。
4.根据权利要求1的方法,其中上述集成,激活和重试的步骤是在无连接协议系统中执行的。
5.在用套接字函数建立系统间通信时使用的套接字绑定的方法,该方法包括以下步骤:
检测到套接字分配中的一个失败;及
在预定时间之后重新进行套接字的分配。
6.根据权利要求5的方法,其中上述的预定时间是由基于系统关闭一个异常的套接字的时间延迟确定的。
7.根据权利要求5的方法,其中上述的检测和重试步骤是在面向连接协议的系统中执行的。
8.根据权利要求5的方法,其中上述的检测和重试的步骤是在无连接协议系统中执行的。
CN97122466A 1996-11-07 1997-11-06 使用套接字函数的通信系统中的套接字绑定方法 Expired - Fee Related CN1099183C (zh)

Applications Claiming Priority (3)

Application Number Priority Date Filing Date Title
KR52637/1996 1996-11-07
KR52637/96 1996-11-07
KR1019960052637A KR19980034552A (ko) 1996-11-07 1996-11-07 소켓기능을 이용한 통신시스템의 소켓바인딩 방법

Publications (2)

Publication Number Publication Date
CN1182240A CN1182240A (zh) 1998-05-20
CN1099183C true CN1099183C (zh) 2003-01-15

Family

ID=19481095

Family Applications (1)

Application Number Title Priority Date Filing Date
CN97122466A Expired - Fee Related CN1099183C (zh) 1996-11-07 1997-11-06 使用套接字函数的通信系统中的套接字绑定方法

Country Status (8)

Country Link
US (1) US5941950A (zh)
JP (1) JPH10187567A (zh)
KR (1) KR19980034552A (zh)
CN (1) CN1099183C (zh)
DE (1) DE19748009B4 (zh)
FR (1) FR2755560B1 (zh)
GB (1) GB2319151A (zh)
RU (1) RU2171491C2 (zh)

Families Citing this family (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6192389B1 (en) * 1997-03-28 2001-02-20 International Business Machines Corporation Method and apparatus for transferring file descriptors in a multiprocess, multithreaded client/server system
US6216163B1 (en) * 1997-04-14 2001-04-10 Lucent Technologies Inc. Method and apparatus providing for automatically restarting a client-server connection in a distributed network
US6487581B1 (en) * 1999-05-24 2002-11-26 Hewlett-Packard Company Apparatus and method for a multi-client event server
US6529965B1 (en) * 2000-05-09 2003-03-04 3Com Corporation Method of detecting TCP/IP bindings of installed network interface cards present in a computer system
KR100451786B1 (ko) * 2000-11-30 2004-10-08 엘지전자 주식회사 이동통신 시스템의 소켓 자동 관리 방법
US8566849B2 (en) * 2000-12-14 2013-10-22 Borland Software Corporation Name service object clustering
US6922727B2 (en) * 2001-06-26 2005-07-26 International Business Machines Corporation Method and system for managing parallel data transfer through multiple sockets to provide scalability to a computer network
US6895590B2 (en) 2001-09-26 2005-05-17 Intel Corporation Method and system enabling both legacy and new applications to access an InfiniBand fabric via a socket API
US7254739B2 (en) 2003-11-19 2007-08-07 International Business Machines Corporation Error recovery in a client/server application using two independent sockets for communication
US20060050717A1 (en) * 2004-09-09 2006-03-09 International Business Machines Corporation Reducing delays associated with port binding
JP2007114879A (ja) * 2005-10-18 2007-05-10 Ricoh Co Ltd 構造化文書、端末装置、構造化文書の作成プログラム及び構造化文書の作成装置
WO2008070217A2 (en) * 2006-08-09 2008-06-12 Qualcomm Incorporated Apparatus and method for supporting broadcast/multicast ip packets through a simplified sockets interface
US8037039B2 (en) * 2007-04-20 2011-10-11 Microsoft Corporation Runtime class database operation
CN102130944B (zh) * 2010-12-30 2013-05-15 中国民航信息网络股份有限公司 一种对自助柜机和自助系统的监控管理方法
CN102404858B (zh) 2011-11-25 2014-04-02 华为技术有限公司 一种无线资源优化方法、装置及系统

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP0613274A2 (en) * 1993-01-29 1994-08-31 International Business Machines Corporation Socket structure for concurrent multiple protocol access
WO1995008903A1 (en) * 1993-09-20 1995-03-30 Codex Corporation, A Subsidiary Company Of Motorola Inc. Method for dynamic connection management in integrated communication networks

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
GB2232855B (en) * 1989-06-07 1993-10-20 Secr Defence Computer network access control system
GB2259387B (en) * 1991-09-07 1994-11-02 Motorola Israel Ltd Communications apparatus
US5313655A (en) * 1992-01-30 1994-05-17 Motorola, Inc. Method for reducing control channel activity for limited audience communications
US5631897A (en) * 1993-10-01 1997-05-20 Nec America, Inc. Apparatus and method for incorporating a large number of destinations over circuit-switched wide area network connections
US5758084A (en) * 1995-02-27 1998-05-26 Hewlett-Packard Company Apparatus for parallel client/server communication having data structures which stored values indicative of connection state and advancing the connection state of established connections
US5774479A (en) * 1995-03-30 1998-06-30 Motorola, Inc. Method and system for remote procedure call via an unreliable communication channel using multiple retransmission timers

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP0613274A2 (en) * 1993-01-29 1994-08-31 International Business Machines Corporation Socket structure for concurrent multiple protocol access
WO1995008903A1 (en) * 1993-09-20 1995-03-30 Codex Corporation, A Subsidiary Company Of Motorola Inc. Method for dynamic connection management in integrated communication networks

Also Published As

Publication number Publication date
CN1182240A (zh) 1998-05-20
RU2171491C2 (ru) 2001-07-27
GB9723131D0 (en) 1998-01-07
JPH10187567A (ja) 1998-07-21
DE19748009B4 (de) 2008-09-25
US5941950A (en) 1999-08-24
KR19980034552A (ko) 1998-08-05
DE19748009A1 (de) 1998-05-14
FR2755560A1 (fr) 1998-05-07
FR2755560B1 (fr) 2000-12-29
GB2319151A (en) 1998-05-13

Similar Documents

Publication Publication Date Title
CN1099183C (zh) 使用套接字函数的通信系统中的套接字绑定方法
EP1025507B1 (en) Combined internet and data access system
US7080219B2 (en) Storage controlling device and control method for a storage controlling device
EP0613274B1 (en) Socket structure for concurrent multiple protocol access
US7912858B2 (en) Data synchronization method
US5005122A (en) Arrangement with cooperating management server node and network service node
JPS62284455A (ja) 分散型対話処理方式
US5960178A (en) Queue system and method for point-to-point message passing having a separate table for storing message state and identifier of processor assigned to process the message
WO2006019512B1 (en) Apparatus and method for supporting connection establishment in an offload of network protocol processing
CN111858007A (zh) 一种基于消息中间件的任务调度方法方法和装置
JPH06103205A (ja) アダプタインストール装置及び方法、並びにコンピュータ装置
CA2045226C (en) Nonvolatile memory management in a data processing network
JP3361761B2 (ja) データベース併合方法
JPH08263409A (ja) 通信ソフトウェアダウンロード方法及びシステム
US6370654B1 (en) Method and apparatus to extend the fault-tolerant abilities of a node into a network
CN113157405A (zh) 业务流程断点重试的方法和装置
CN1135471C (zh) 管理进程的方法
US20030061257A1 (en) Multithreaded universal daemon for network data exchanges
CN111651147B (zh) 一种系统快速搭建组件的方法
KR100413422B1 (ko) 멀티포트 제어기에서의 멀티포트 제어 방법
KR0136952B1 (ko) 차량 부품 검색 시스템에서의 클라이언트와 서버간의 데이터 교환 방법
JPH0675892A (ja) 遠隔手続き管理装置
JP2912046B2 (ja) ファイルサーバの制御方法
JPS63209248A (ja) システム間デ−タ着信制御方式
Krechmer Applications programming interfaces for communications (programmable communications interfaces)

Legal Events

Date Code Title Description
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C06 Publication
PB01 Publication
C14 Grant of patent or utility model
GR01 Patent grant
C19 Lapse of patent right due to non-payment of the annual fee
CF01 Termination of patent right due to non-payment of annual fee