KR20020033219A - Method for materializing connection-oriented socket interface - Google Patents

Method for materializing connection-oriented socket interface Download PDF

Info

Publication number
KR20020033219A
KR20020033219A KR1020000063835A KR20000063835A KR20020033219A KR 20020033219 A KR20020033219 A KR 20020033219A KR 1020000063835 A KR1020000063835 A KR 1020000063835A KR 20000063835 A KR20000063835 A KR 20000063835A KR 20020033219 A KR20020033219 A KR 20020033219A
Authority
KR
South Korea
Prior art keywords
socket
connection
server
client
data
Prior art date
Application number
KR1020000063835A
Other languages
Korean (ko)
Inventor
김길남
Original Assignee
구자홍
엘지전자주식회사
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 구자홍, 엘지전자주식회사 filed Critical 구자홍
Priority to KR1020000063835A priority Critical patent/KR20020033219A/en
Publication of KR20020033219A publication Critical patent/KR20020033219A/en

Links

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
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols

Abstract

PURPOSE: A method for embodying a connection-oriented socket interface is provided to make a transmission control protocol/internet protocol(TCP/IP) application program even if a detailed system call regarding a socket is not known. CONSTITUTION: A connection-oriented socket interface module is initiated, and a port number and a connection identifier wherein a server waits for a connection request from a client are supplied. A user periodically calls an interface function of the server to inspect whether a socket connection request from the client is made. When the socket connection request is made from the client, a connection identifier regarding the socket to communicate with the server is given to a user at the client so that a data communication between the server and the client is made through the connection identifier. The socket is disconnected when the data communication through the connection socket between the server and the client is completed or a socket at either one of the server or client is abnormally finished.

Description

연결지향 소켓 인터페이스 구현방법 {Method for materializing connection-oriented socket interface}How to implement a connection-oriented socket interface {Method for materializing connection-oriented socket interface}

본 발명은 서버 클라이언트 시스템의 소켓 인터페이스(Socket Interface)에 관한 것으로, 특히 연결지향 소켓 인터페이스(Connection-Oriented SocketInterface)를 구현하여 TCP/IP(Transmission Control Protocol/Internet Protocol) 응용프로그램의 개발 또는 작성을 용이하게 한 연결지향 소켓 인터페이스 구현방법에 관한 것이다.The present invention relates to a socket interface of a server client system, and in particular, implements a connection-oriented socket interface to facilitate the development or creation of a Transmission Control Protocol / Internet Protocol (TCP / IP) application. It relates to a connection-oriented socket interface implementation method.

일반적으로 서버 클라이언트 시스템에서 동작하는 TCP/IP 응용프로그램을 작성하고자 할 때 거의 모든 플랫폼(Platform, 예를 들어 windows 또는 UNIX)에서 제공하는 소켓(socket)을 사용한다.In general, when you want to write a TCP / IP application that runs on a server client system, you use sockets provided by almost any platform (such as Platform or Windows or UNIX).

특히, 연결지향(connection-oriented)이 요구되는 응용프로그램을 위해서 스트림 소켓(stream socket)을 사용하게 된다. 스트림 소켓 관련 시스템 호출은 다양하며, 응용프로그램은 상기 스트림 소켓을 이용하여 여러 시스템 호출을 조합하여 작성하게 된다.In particular, stream sockets are used for applications that require connection-oriented applications. Stream socket related system calls vary, and an application program may make a combination of several system calls using the stream socket.

도1에는 서버 클라이언트 시스템의 구성도가 도시되어 있다.1 is a block diagram of a server client system.

상기 도1에 도시된 바와 같이 서버 클라이언트 시스템은 네트워크를 통하여 서로간에 데이터 교환을 위한 경로를 설정하게 되는데, 상기 데이터 교환의 경로는 해당 네트워크가 사용하는 프로토콜(protocol)에 따라 그 동작 체계가 다르다.As shown in FIG. 1, the server client system sets a path for data exchange between each other through a network. The path of the data exchange differs depending on a protocol used by the network.

TCP/IP 프로토콜을 사용하는 네트워크의 경우, 소켓의 상태에 따라 순서적으로 각 시스템 호출을 사용하여야 한다.In the case of a network using the TCP / IP protocol, each system call must be used in order according to the state of the socket.

상기에서 소켓이란 프로세서의 사용자가 시스템이나 네트워크 등의 환경을 의식하지 않고, 프로세스간 통신을 마치 파일의 입출력과 같이 처리할 수 있도록 한 환경을 제공하는 것이다. 이는 OSI 참조모델의 세션층(session layer)에 해당하는 기술이며, TCP/IP의 응용프로그램 인터페이스로써 적용된다.In the above, the socket is to provide an environment in which the user of the processor can process the interprocess communication as if the input and output of the file, without being aware of the environment of the system or the network. This technique corresponds to the session layer of the OSI reference model and is applied as an application program interface of TCP / IP.

소켓의 개시는 통신을 하는 2개의 프로세스가 socket() 시스템 호출에 의한 소켓 선언을 수행하여 통신의 입출력 경로가 되는 소켓을 작성하는 것으로부터 이루어진다. 이어서 각 프로세스가 서로를 인식할 수 있는 이름을 그 소켓에 붙이기 위해 bind() 시스템 호출을 실행한다. 소켓의 이름은 같은 도메인내, 인터넷내, 제록스XNS네트워크내 등 3가지 타입별로 정의되어 있다.The initiation of a socket consists of the two communicating processes making the socket declaration by the socket () system call to create a socket that becomes the input / output path of the communication. It then executes the bind () system call to give the socket a name that each process can recognize. Socket names are defined by three types: in the same domain, in the Internet, and in a Xerox XNS network.

소켓의 접속은 listen() 시스템 호출을 통해 서버가 되는 프로세스의 접수준비를 수행하고, connect() 시스템 호출을 통해 클라이언트가 될 프로세스로부터의 소켓 접속요구를 수행하며, accept() 시스템 호출을 통해 서버의 요구접수가 이루어진다.The socket connection performs the preparation of receiving the process of the server through the listen () system call, the socket connection request from the process of the client through the connect () system call, and the server through the accept () system call. Receipt of request is made.

상기 동작으로 서버와 클라이언트간의 소켓 연결이 이루어지면, 일반파일의 입출력과 같이 read()/write() 시스템 호출을 통해 데이터의 송수신이 수행된다. 그리고 데이터 통신의 종료는 close() 시스템 호출에 의해 이루어진다.When the socket connection is established between the server and the client through the above operation, data is transmitted and received through a read () / write () system call like the input / output of a normal file. Termination of data communication is done by the close () system call.

그런데, 소켓 연결에 있어서 복잡한 시스템 호출을 적시에 사용하지 못한다면, 원하는 서비스를 제공할 수 없을 뿐만 아니라 프로그램의 성능을 제대로 발휘할 수 없게 될 것이다.However, if you do not make timely use of complex system calls on socket connections, you will not only be able to provide the desired services, but also the performance of your program.

본 발명은 서버 클라이언트 시스템의 소켓 인터페이스를 개선하고자 하는 것으로, 이에 대비되는 종래기술을 설명하면 다음과 같다.The present invention is intended to improve the socket interface of the server client system, the prior art will be described as follows.

먼저, 도2는 종래기술에 의한 서버 클라이언트 시스템의 소켓 인터페이스 구성도이다.First, Figure 2 is a block diagram of a socket interface of a server client system according to the prior art.

상기 도2에 도시된 바와 같이 종래의 인터페이스는, 기본적으로 TCP/IP 프로토콜에 따르는 것으로 상기 프로토콜을 위한 응용프로그램은 클라이언트 서버 구조로 구성되어 동작하게 된다.As shown in FIG. 2, the conventional interface basically conforms to the TCP / IP protocol, and the application program for the protocol operates in a client server structure.

종래에는 소켓 연결설정 절차에서 서버측이 연결요구를 기다리기 위해 순차적으로 시스템 호출을 사용하여 처리하게 된다. 이때 사용되는 시스템 호출루틴의 예를 들면, socket(), bind(), listen(), accept() 등이다. 상기 accept() 시스템 호출은 blocking 모드로 동작하여 클라이언트측의 연결요구에 대해 정상적으로 소켓 연결이 이루어지기까지 계속 대기하는 상태가 된다.Conventionally, in the socket connection establishment process, the server side processes the system call sequentially to wait for the connection request. Examples of system call routines used here include socket (), bind (), listen (), and accept (). The accept () system call operates in a blocking mode, and continuously waits for a socket connection to be normally made for a client's connection request.

그리고 클라이언트측은 소켓을 생성한 후, 소켓 연결을 서버측에 요구하게 된다. 즉, 클라이언트가 소켓(socket())을 생성한 후에 상기 소켓에 따라 연결설정(connect())을 요구하는 것이다.The client side creates a socket and then requests the server side for a socket connection. That is, after a client creates a socket (socket ()), it requests a connection (connect ()) according to the socket.

그래서 서버와 클라이언트간의 소켓 연결이 이루어지면, 상기 연결의 각 주체간 데이터 교환이 가능하게 된다.Thus, when a socket connection is made between the server and the client, data exchange between the subjects of the connection is possible.

상기 연결관리 처리는 서버의 경우, blocking 모드에서 클라이언트측의 연결을 기다리고, 클라이언트는 서버로의 연결요구에 대한 응답을 기다리면서 수행된다. 이러한 서버측과 클라이언트측간의 동기처리는 응용프로그램 개발시 각 개발자마다 다를 수 있다.The connection management process is performed in the blocking mode, waiting for the client side in the blocking mode, and waiting for a response to the connection request to the server. The synchronization process between the server side and the client side may be different for each developer when developing an application program.

상기의 동작으로 일단 연결설정이 이루어지면, 각 주체간의 데이터 송수신이 가능하게 된다. 그리고 연결 주체간의 데이터 교환이 완료되어 더 이상의 데이터 교환이 불필요한 경우에는 더 상기 설정되어 있는 연결을 해제하게 된다.Once the connection is established by the above operation, data transmission and reception between each subject is possible. When the data exchange between the connecting entities is completed and no further data exchange is necessary, the established connection is further released.

이러한 일련의 동작을 보다 구체적으로 설명하기로 한다.This series of operations will be described in more detail.

서버측에서 socket(), bind(), listen(), accept() 등의 함수가 호출되어 소켓을 열고 클라이언트측과의 연결이 설정될 때까지 대기하는 일련의 단계가 수행된다. 이때 클라이언트측은 socket(), connect() 함수를 차례로 호출하여 소켓을 열고 해당 소켓을 통하여 서버측에 소켓연결을 요구하게 된다.Functions such as socket (), bind (), listen (), and accept () are called on the server side, and a series of steps are performed to open the socket and wait for a connection with the client side to be established. At this time, the client side calls socket () and connect () functions in order to open a socket and request a socket connection from the server side through the socket.

상기 클라이언트측의 연결요구에 의해 서버측의 소켓과 클라이언트측 소켓간의 연결이 이루어지면(connection establishment), 클라이언트측은 write() 또는 send() 루틴을 호출하여 서버측으로 전송할 데이터를 요청하게 된다(data(request)).When a connection is established between the server side socket and the client side socket by the client side connection request, the client side calls a write () or send () routine to request data to be transmitted to the server side. request)).

상기 데이터 요청에 의해 서버측은 read() 또는 recv() 루틴이 호출되어 클라이언트측의 요청을 수신하고, 상기 요청된 데이터의 처리를 수행한 후 연결된 소켓을 통한 데이터 전송과정을 수행하게 된다.In response to the data request, the server side calls a read () or recv () routine to receive a request from the client, performs a process of the requested data, and then performs a data transmission process through a connected socket.

상기 클라이언트측의 요청에 대한 응답은 서버측이 상기 요청 데이터를 처리한 결과를 write() 또는 send() 루틴을 호출하여 클라이언트측으로 전송하는 것에 의해 이루어진다(data(reply)). 이때 서버측이 전송하는 응답 데이터의 수신은 클라이언트측의 read() 또는 recv() 루틴에 의하여 이루어진다.The response to the client side request is made by the server side sending the result of processing the request data to the client side by calling a write () or send () routine (data (reply)). At this time, the response data transmitted from the server side is received by the read () or recv () routine of the client side.

연결된 소켓을 통한 데이터 교환은 상기 체계에 따라 반복적으로 수행되며, 데이터의 전송이 완료되는 경우에는 상기 소켓의 연결상태를 해제하게 된다. 서버 클라이언트 시스템은 소수의 서버에 다수의 클라이언트가 소켓을 통하여 연결되기 때문에 한정된 시스템 자원의 관리가 필요하며, 자원관리시 상기 소켓의 연결설정 및 연결해제가 수행된다.Data exchange through the connected socket is repeatedly performed according to the above scheme, and when the data transmission is completed, the connection state of the socket is released. The server client system requires limited management of system resources because a large number of clients are connected to a small number of servers through sockets, and connection and disconnection of the sockets is performed during resource management.

소켓의 연결해제는 클라이언트측이 더 이상 전송할 데이터가 없는 경우에 close() 루틴을 호출하여 소켓을 닫게 되는데, 상기 close() 루틴은 서버측에 대해 연결해제를 통지하게 된다. 그러면 서버측에서 상기 연결해제 통지를 수신하여 close() 루틴을 호출함으로써 해당 소켓의 연결상태를 해제하고 소켓 자원을 가용한 상태로 복원시키게 된다.Disconnecting a socket causes the client side to close the socket by invoking the close () routine when there is no more data to send, and the close () routine notifies the server side of the disconnection. Then, the server side receives the disconnect notification and calls the close () routine to disconnect the socket and restore the socket resource to the available state.

그러나 상기 설명한 종래기술은, 다중연결이 필요한 경우에 각 연결에 대한 정보를 관리해야만 하는 불편이 있었다.However, the prior art described above has the inconvenience of managing information on each connection when multiple connections are required.

또한, 소켓 관련 시스템 호출을 사용하기 때문에 연결관리 구조가 매우 복잡해지는 문제점이 있었다.In addition, there is a problem that the connection management structure is very complicated because it uses a socket-related system call.

이에 본 발명은 상기와 같은 종래의 제반 문제점을 해소하기 위해 제안된 것으로, 본 발명의 목적은 서버 클라이언트 시스템에 있어서, 연결지향 소켓 인터페이스(Connection-Oriented Socket Interface)를 구현하여 TCP/IP(Transmission Control Protocol/Internet Protocol) 응용프로그램의 개발 또는 작성을 용이하게 한 연결지향 소켓 인터페이스 구현방법을 제공하는 데 있다.Accordingly, the present invention has been proposed to solve the above conventional problems, and an object of the present invention is to implement a connection-oriented socket interface (TCP / IP) in a server client system. Protocol / Internet Protocol) A method for implementing a connection-oriented socket interface that facilitates the development or writing of an application program.

상기와 같은 목적을 달성하기 위하여 본 발명에 의한 연결지향 소켓 인터페이스 구현방법은, 연결지향 소켓 인터페이스 모듈을 초기화하고 서버측이 클라이언트측의 연결요구를 대기하는 포트번호 및 연결식별자를 제공하는 단계와; 사용자가 서버측 인터페이스 함수를 주기적으로 호출하여 클라이언트측으로부터의 소켓 연결요구가 발생되는지를 확인하는 단계와; 클라이언트측의 소켓 연결요구가 발생되면,서버와 통신할 소켓에 대한 연결식별자를 클라이언트측 사용자에게 부여하여 상기 연결식별자를 통해 서버측과 클라이언트측간의 데이터 통신이 수행되도록 하는 단계와; 서버측과 클라이언트측간의 연결 소켓을 통한 데이터 통신이 완료되거나 일측의 소켓이 비정상적으로 종료되는 경우에는 상기 소켓 연결을 해제하는 단계를 수행함을 그 기술적 구성상의 특징으로 한다.In order to achieve the above object, a connection-oriented socket interface implementation method according to the present invention includes: initializing a connection-oriented socket interface module and providing a port number and a connection identifier for a server side waiting for a client side connection request; A user periodically calling a server-side interface function to check whether a socket connection request from a client side occurs; When a socket connection request on the client side occurs, granting a client side user a connection identifier for a socket to communicate with the server to perform data communication between the server side and the client side through the connection identifier; When the data communication through the connection socket between the server side and the client side is completed or one socket is abnormally terminated, the step of releasing the socket connection is characterized in that the technical configuration.

도1에는 서버 클라이언트 시스템의 구성도가 도시되어 있고,1 is a block diagram of a server client system,

도2는 종래기술에 의한 서버 클라이언트 시스템의 소켓 인터페이스 구성도이며,2 is a block diagram illustrating a socket interface of a server client system according to the related art.

도3은 본 발명이 적용되는 프로토콜 스택의 구성도이고,3 is a block diagram of a protocol stack to which the present invention is applied;

도4는 도3에서 본 발명의 일실시예에 의한 연결지향 소켓 인터페이스의 상세블록도이며,4 is a detailed block diagram of a connection-oriented socket interface according to an embodiment of the present invention in FIG.

도5는 본 발명의 본 발명의 일실시예에 의한 연결지향 소켓 인터페이스의 운용방법 흐름도이다.5 is a flowchart illustrating a method of operating a connection-oriented socket interface according to an embodiment of the present invention.

이하, 상기와 같은 연결지향 소켓 인터페이스 구현방법의 기술적 사상에 따른 실시예에 의거 본 발명의 구성 및 동작을 설명한다.Hereinafter, the configuration and operation of the present invention will be described based on the embodiment of the present invention.

먼저, 도3은 본 발명이 적용되는 프로토콜 스택의 구성도이고, 도4는 도3에서 본 발명의 일실시예에 의한 연결지향 소켓 인터페이스의 상세블록도이며, 도5는 본 발명의 본 발명의 일실시예에 의한 연결지향 소켓 인터페이스의 운용방법 흐름도이다.First, Figure 3 is a block diagram of a protocol stack to which the present invention is applied, Figure 4 is a detailed block diagram of a connection-oriented socket interface according to an embodiment of the present invention in Figure 3, Figure 5 is a view of the present invention 1 is a flowchart illustrating a method of operating a connection-oriented socket interface according to an embodiment.

상기 도5에 도시된 바와 같이 본 발명의 적절한 실시예는, 인터페이스 모듈을 초기화하고 서버측이 클라이언트측의 연결요구를 대기하는 포트번호 및 연결식별자를 제공하는 단계(ST21~ST22)와; 운용자가 서버측 인터페이스 함수를 주기적으로 호출하여 클라이언트측으로부터의 소켓 연결요구가 발생되는지를 확인하는 단계(ST23~ST24)와; 클라이언트측의 소켓 연결요구가 발생되면, 서버와 통신할 소켓에 대한 연결식별자를 클라이언트측 사용자에게 부여하여 상기 연결식별자를 통해 서버측과 클라이언트측간의 데이터 통신이 수행되도록 하는 단계(ST25~ST26)와;서버측과 클라이언트측간의 연결 소켓을 통한 데이터 통신이 완료되거나 일측의 소켓이 비정상적으로 종료되는 경우에는 상기 소켓 연결을 해제하는 단계(ST27~ST28)를 포함하여 구성된다.As shown in FIG. 5, a preferred embodiment of the present invention includes the steps of: initializing an interface module and providing a port number and a connection identifier for a server side waiting for a client side connection request (ST21 to ST22); An operator periodically calling a server-side interface function to check whether a socket connection request from a client side occurs (ST23 to ST24); When a socket connection request on the client side is generated, granting a connection identifier for the socket to communicate with the server to the client side user to perform data communication between the server side and the client side through the connection identifier (ST25 ~ ST26) and When the data communication through the connection socket between the server side and the client side is completed or the socket on one side is abnormally terminated, the step of releasing the socket connection (ST27 ~ ST28) is configured.

이와 같이 구성되는 방법에 따른 동작을 설명하면 다음과 같다.Operation according to the method configured as described above is as follows.

본 발명은 TCP/IP를 통과하는 스트림 소켓(stream socket)을 이용하여 데이터를 주고 받는 인터페이스 기능을 제공함으로써 실질적인 소켓 이용을 단순화시키게 된다.The present invention simplifies the actual socket use by providing an interface function of sending and receiving data using a stream socket through TCP / IP.

상기 스트림 소켓은 연결지향 소켓에 해당한다. 연결지향(connection-oriented 또는 stream-oriented)이란 전송계층 데이터 통신 서비스의 일종으로 일측의 호스트가 다른 일측의 호스트로 연속적인 스트림 데이터를 보내는 것을 말한다. 이때 연결지향 서비스는 전송되는 모든 데이터가 동일한 순서 및 중복없이 수신측에 도달되는 것을 보증한다. 이러한 연결지향 서비스는 3 개의 단계로 수행되는데, 연결설정 단계와 데이터 전달단계 및 연결해제 단계이다.The stream socket corresponds to a connection-oriented socket. Connection-oriented or stream-oriented is a type of transport layer data communication service, in which one host sends continuous stream data to another host. At this point, the connection-oriented service guarantees that all data transmitted is reached at the receiving end without the same order and duplication. This connection-oriented service is performed in three stages: connection establishment, data transfer and disconnection.

연결지향 서비스의 대표적인 경우가 TCP 프로토콜이다.The typical case of connection-oriented services is the TCP protocol.

본 발명에 제시하는 연결지향 소켓 인터페이스를 위한 프로토콜 스택(protocol stack)의 구조는 도3에 도시되어 있는 바와 같다.The structure of the protocol stack for the connection-oriented socket interface proposed in the present invention is as shown in FIG.

도3의 프로토콜을 이용하는 경우, 서버/클라이언트측에 관계없이 사용자는 연결에 대한 연결식별자를 이용하여 데이터를 송수신 할 수 있다. 여기에서 연결지향 소켓 인터페이스(Connect-Oriented Socket Interface)는 COSI로 표기되어 있다.When using the protocol of Figure 3, regardless of the server / client side, the user can send and receive data using the connection identifier for the connection. Here, the Connect-Oriented Socket Interface is denoted by COSI.

상기 프로토콜을 위한 연결지향 인터페이스(COSI) 함수는 다음과 같다.The Connection Oriented Interface (COSI) function for the protocol is as follows.

초기화 함수는 내부적으로 사용할 테이블을 할당하고 사용자의 파라미터를 입력 받는다.The initialization function allocates a table for internal use and receives user parameters.

연결요구 함수는 서버 소켓 열기, 클라이언트 소켓 열기 및 서버 연결관리를 수행하기 위한 서브함수를 호출하게 된다. 서버 소켓 열기 서브함수는 서버측이 소켓을 생성하여 연결요구를 기다리도록 하고, 클라이언트 소켓 열기 서브함수는 클라이언트측이 소켓을 생성하여 연결요구를 수행하도록 하며, 서버 연결관리 서브함수는 서버측이 클라이언트의 연결요구를 검사하여 연결요구에 대한 응답을 수행하게 된다.The connection request function calls subfunctions for performing server socket opening, client socket opening, and server connection management. The server socket open subfunction allows the server side to create a socket and wait for a connection request, and the client socket open subfunction causes the client side to create a socket to perform a connection request, and the server connection management subfunction allows the server side to It examines the connection request of and performs the response to the connection request.

연결해제 함수는 서버/클라이언트간에 설정된 소켓 연결상태를 해제하도록 한다.The disconnect function allows you to release the socket connection between the server and the client.

데이터 송수신 함수는 데이터의 송신, 수신1, 수신2 및 수신확인 기능을 수행하게 된다. 상기 송신기능은 이미 생성된 연결로 데이터를 송신하는 것이고, 수신1은 이미 생성된 연결로부터 데이터의 최대크기를 지정하여 수신하는 것이다. 그리고 수신2는 이미 생성된 연결로부터 데이터를 원하는 양만큼 수신하는 것이고, 수신확인 기능은 수신되는 데이터가 있는지를 확인하는 것이다.The data transmission / reception function performs data transmission, reception 1, reception 2 and acknowledgment functions. The transmission function is to transmit data on an already created connection, and reception 1 is to designate and receive a maximum size of data from an already created connection. Receive 2 is to receive the desired amount of data from the connection already created, and the acknowledgment function is to check whether there is data received.

기타의 함수로는 상태정보의 처리를 위한 함수 등이 있다.Other functions include functions for processing status information.

이러한 각 함수간의 기능적 연관 및 전체적인 동작흐름을 첨부도면을 참조하여 보다 구체적으로 설명하기로 한다.Functional associations between the respective functions and the overall operation flow will be described in more detail with reference to the accompanying drawings.

도4에는 본 발명이 제시하는 연결지향 소켓 인터페이스의 적용예가 도시되어 있다.Figure 4 shows an application example of the connection-oriented socket interface proposed in the present invention.

도5에 제시된 동작흐름과 같이, 연결지향 소켓 인터페이스를 사용하기 위해서는 각 모듈을 초기화하는 단계를 거쳐야 한다(ST21).As shown in FIG. 5, in order to use the connection-oriented socket interface, each module must be initialized (ST21).

초기화 단계에서 입력되는 파라미터는 사용자가 사용할 최대 연결의 수, 사용자가 보내는 최대 메시지의 크기, 수신 가능한 메시지의 크기 등이다. 이때 인터페이스 모듈의 초기화시 사용되는 파라미터는 해당 인터페이스 모듈의 관리에 있어서 편의성을 위한 것으로, 해당 인터페이스 함수의 기능과 직접적인 연관을 갖는 것은 아니다.Parameters entered during the initialization phase include the maximum number of connections the user will use, the size of the maximum message the user will send, and the size of the message that can be received. In this case, the parameters used when the interface module is initialized are for convenience in managing the interface module and do not have a direct relationship with the function of the interface function.

상기 파라미터를 사용하여 모듈의 초기화에 성공하게 되면, 연결요구를 수행할 수 있게 된다.If the module is successfully initialized using the parameter, the connection request can be performed.

연결요구는 서버와 클라이언트측에 따라 서로 다르다.Connection requests are different for the server and client side.

연결요구시 서버측은 연결요구를 기다리는 포트번호를 입력으로 제공한다. 상기 입력에 대해 해당 포트의 연결이 이루어지면 해당 연결에 대한 연결식별자를 사용자에게 제공하게 된다(ST22).When a connection request is made, the server side provides as an input the port number waiting for the connection request. When the corresponding port is connected to the input, the connection identifier for the corresponding connection is provided to the user (ST22).

이때 서버의 내부에서 상기 연결요구를 처리하여 소켓 연결을 수행하는 일련의 단계는 종래기술과 같은 일정한 시스템 호출함수가 사용된다.In this case, a series of steps of processing the connection request in the server to perform a socket connection are performed using a constant system call function as in the prior art.

그리고 클라이언트로부터 연결요구를 확인하기 위해 사용자는 주기적으로 인터페이스 함수에 의해 호출된다(ST23). 즉, 인터페이스 함수 내부에 프로세스(또는 태스크)가 존재하지 않기 때문에 사용자에 의해 수행되는 것이다.In order to confirm the connection request from the client, the user is periodically called by the interface function (ST23). That is, it is performed by the user because no process (or task) exists inside the interface function.

그래서 클라이언트측의 연결요구는 포트번호를 입력으로 제공하며, 상기 요구된 연결이 이루어지면 서버측과 통신할 수 있는 연결식별자를 사용자에게 부여한다(ST24~ST25).Thus, the connection request on the client side provides a port number as an input, and when the requested connection is made, a connection identifier capable of communicating with the server side is given to the user (ST24 to ST25).

이상의 절차가 모두 성공적으로 수행되면, 사용자는 각 연결 식별자를 이용하여 생성된 연결을 통한 데이터 송수신을 수행할 수 있게 된다(ST26).If all of the above procedures are successfully performed, the user can perform data transmission and reception through the generated connection using each connection identifier (ST26).

우선 데이터 송신에 있어서는, 사용자가 부여받은 연결 식별자를 이용하여 메시지를 보내는 경우 소켓을 이용하여 상대편으로 송신하게 된다.First, in data transmission, when a message is sent by using a connection identifier assigned by a user, a message is transmitted to the other party by using a socket.

데이터 수신에 있어서는, 2가지 방식이 사용자에게 제공된다.In data reception, two methods are provided for the user.

그 첫째는 원하는 데이터의 크기를 지정하여 수신하는 경우로써, 수신1 방식이라 칭한다. 상기 수신1 방식은 사용자가 수신할 다음 데이터의 크기를 알고 있을 사용되는 방식이다.The first is a case where a desired size of data is received and is called a reception 1 method. The reception 1 method is a method used by the user to know the size of the next data to be received.

그리고 두 번째는 사용자가 받을 수 있는 데이터의 크기를 지정하여 수신하는 방식으로, 수신2 방식이라 칭한다. 상기 수신2 방식은 사용자가 요구한 최대크기를 넘는 데이터가 있는 경우에는 그 최대크기만큼을 사용자에게 제공하는 방식이다. 이때 사용자는 최대크기를 넘음으로써 남게 되는 데이터에 대하여 다시 수신처리하여야 한다.The second method is to designate and receive the size of data that a user can receive. The reception 2 method provides a user with the maximum size when there is data exceeding the maximum size requested by the user. At this time, the user should receive the data again after exceeding the maximum size.

이러한 수신1 및 수신2 방식은 스트림 소켓의 동작특성에 의한 것으로, 스트림 소켓에서는 상대편이 보낸 메시지의 시작과 끝을 구분할 수 없어 상기와 같은 수신방식에 제공된다. 따라서 메시지의 시작과 끝은 사용자가 결정하여야 한다.The reception 1 and reception 2 methods are based on the operation characteristics of the stream socket. In the stream socket, since the start and end of the message sent from the other party cannot be distinguished, they are provided in the reception method as described above. Therefore, the start and end of the message must be determined by the user.

상기 설명한 일련의 데이터 송수신 동작을 수행하여 더 이상 데이터 송수신이 요구되지 않는 경우에는, 사용자의 요구에 따라 소켓 연결을 해제하게 된다.When the data transmission / reception is no longer required by performing the series of data transmission / reception operations described above, the socket connection is released according to a user's request.

소켓 연결 해제는 데이터 송수신 완료의 경우에만 이루어지는 것이 아니고,상대편이 비정상적으로 종료되었을 경우에도 이루어진다. 상대편의 비정상 종료에 의한 소켓 연결 해제여부는 사용자가 직접 결정하게 된다(ST27~ST28).The socket disconnection is not only performed when data transmission and reception is completed, but also when the other end is abnormally terminated. It is up to the user to decide whether to disconnect the socket due to abnormal termination of the other party (ST27 ~ ST28).

이처럼 본 발명은 연결지향 소켓 인터페이스를 제공하여 응용프로그램 계층에서 운용자가 수행하는 소켓관리 명령 또는 처리 단계의 수행에 관한 제반사항을 상기 인터페이스에 의해 일괄적으로 수행되도록 함으로써, TCP/IP 소켓의 연결시 서버와 클라이언트간의 요청/승인/해제 등의 절차에 운용자가 참여하지 않아도 되며, 소켓 연결요구에 대해 서버측이 블락킹(Blocking) 모드로 동작하지 않아도 되도록 하는 것이다.As such, the present invention provides a connection-oriented socket interface so that all the matters related to the execution of a socket management command or a processing step performed by an operator in an application program layer are collectively performed by the interface, thereby connecting a TCP / IP socket. The operator does not have to participate in the request / approval / release of the server and the client, and the server side does not have to operate in the blocking mode for the socket connection request.

이상에서 본 발명의 바람직한 실시예를 설명하였으나, 본 발명은 다양한 변화와 변경 및 균등물을 사용할 수 있다. 본 발명은 상기 실시예를 적절히 변형하여 동일하게 응용할 수 있음이 명확하다.Although the preferred embodiment of the present invention has been described above, the present invention may use various changes, modifications, and equivalents. It is clear that the present invention can be applied in the same manner by appropriately modifying the above embodiments.

즉, 장비에서 현재 상태정보를 관리하고 있고, TCP/IP를 통해 상호 연결된 PC에 의해 이를 운용하는 네트워크 구성에 적용할 수 있다. 이러한 구성에서 서로간의 통신으로 정보를 요구하고 응답하는 경우에 적용될 수 있는 것이다.In other words, the current status information is managed in the equipment, and it can be applied to the network configuration which is operated by a PC interconnected via TCP / IP. In such a configuration, it can be applied to requesting and responding to information in communication with each other.

따라서 상기 기재 내용은 하기 특허청구범위의 한계에 의해 정해지는 본 발명의 범위를 한정하는 것이 아니다.Accordingly, the above description does not limit the scope of the invention as defined by the limitations of the following claims.

이상에서 살펴본 바와 같이 본 발명에 의한 연결지향 소켓 인터페이스 구현방법은, 자세한 소켓관련 시스템 호출을 모르는 경우에도 TCP/IP 응용프로그램을용이하게 작성할 수 있도록 하는 효과가 있다.As described above, the connection-oriented socket interface implementation method according to the present invention has an effect of easily writing a TCP / IP application even if a detailed socket-related system call is not known.

그리고 하나의 프로세스(또는 태스크)가 동작하는 환경에서도 서버는 한 포트로 여러 클라이언트와 연결할 수 있게 된다.And even in an environment where one process (or task) runs, the server can connect to multiple clients on one port.

또한, 본 발명에 의한 인터페이스는 기본적으로 non-blocking으로 처리되므로 다중 연결관리가 가능하고 상기 다중 연결에 대한 정보를 사용자가 얻을 수 있기 때문에, 다중 프로세서에서 동작하는 응용프로그램에의 적용이 가능하게 되는 효과를 갖는다.In addition, since the interface according to the present invention is basically processed as non-blocking, multiple connection management is possible and the user can obtain information on the multiple connections, thereby enabling application to an application program operating on multiple processors. Has an effect.

Claims (5)

연결지향 소켓 인터페이스 모듈을 초기화하고 서버측이 클라이언트측의 연결요구를 대기하는 포트번호 및 연결식별자를 제공하는 단계와;Initializing a connection-oriented socket interface module and providing a port number and a connection identifier for the server side to wait for a client side connection request; 사용자가 서버측 인터페이스 함수를 주기적으로 호출하여 클라이언트측으로부터의 소켓 연결요구가 발생되는지를 확인하는 단계와;A user periodically calling a server-side interface function to check whether a socket connection request from a client side occurs; 클라이언트측의 소켓 연결요구가 발생되면, 서버와 통신할 소켓에 대한 연결식별자를 클라이언트측 사용자에게 부여하여 상기 연결식별자를 통해 서버측과 클라이언트측간의 데이터 통신이 수행되도록 하는 단계와;When a socket connection request on the client side is generated, granting a client side user a connection identifier for a socket to communicate with the server to perform data communication between the server side and the client side through the connection identifier; 서버측과 클라이언트측간의 연결 소켓을 통한 데이터 통신이 완료되거나 일측의 소켓이 비정상적으로 종료되는 경우에는 상기 소켓 연결을 해제하는 단계를 포함하여 구성되는 것을 특징으로 하는 연결지향 소켓 인터페이스 구현방법.And releasing the socket connection when data communication through the connection socket between the server side and the client side is completed or the socket on one side is abnormally terminated. 제 1항에 있어서, 상기 연결지향 소켓 인터페이스 모듈은,The method of claim 1, wherein the connection-oriented socket interface module, TCP/IP 프로토콜의 스트림 소켓과 응용프로그램간의 인터페이스를 위해 구현되는 것으로,Implemented to interface between stream sockets and applications in the TCP / IP protocol. 응용프로그램 계층에서의 명령 처리는 서버 소켓 열기, 클라이언트 소켓 열기, 데이터 송신/수신으로 구분되고,Command processing at the application layer is divided into open server socket, open client socket, and send / receive data. 상기 응용프로그램 계층의 각 명령을 처리하기 위한 관련 함수들은 인터페이스 함수에 의해 호출되며, 상기 명령처리 관련 함수를 수행하여 발생되는 데이터 또는 처리 결과는 인터페이스 함수를 통해 해당 명령을 요청한 응용프로그램의 해당 루틴으로 반환시키는 것을 특징으로 하는 연결지향 소켓 인터페이스 구현방법.Related functions for processing each command of the application program layer are called by an interface function, and data or processing result generated by performing the command processing related function is passed to the corresponding routine of the application program requesting the corresponding command through the interface function. A method of implementing a connection-oriented socket interface, comprising returning a message. 제 1항에 있어서, 상기 연결지향 소켓 인터페이스 모듈의 초기화 단계는,The method of claim 1, wherein the initialization of the connection-oriented socket interface module, 사용자가 사용할 최대 소켓 연결의 수, 사용자가 보내는 메시지의 최대 크기 및 수신 가능한 메시지의 최대크기를 파라미터로써 연결지향 소켓 인터페이스 모듈에 전달하여, 상기 파라미터에 따라 해당 인터페이스 모듈이 초기화 되도록 함을 특징으로 하는 연결지향 소켓 인터페이스 구현방법.The maximum number of socket connections to be used by the user, the maximum size of the message sent by the user, and the maximum size of the receivable message are transmitted to the connection-oriented socket interface module as parameters so that the corresponding interface module is initialized according to the parameter. How to implement a connection-oriented socket interface. 제 1항에 있어서, 상기 연결된 소켓을 통한 데이터 송수신 단계는,The method of claim 1, wherein the transmitting and receiving data through the connected socket comprises: 데이터 수신측에서 수신하고자 하는 데이터의 크기를 지정하여 수신하는 것을 특징으로 하는 연결지향 소켓 인터페이스 구현방법.Connection-oriented socket interface implementation method characterized in that the data receiving side to specify the size of the data to receive. 제 1항에 있어서, 상기 연결된 소켓을 통한 데이터 송수신 단계는,The method of claim 1, wherein the transmitting and receiving data through the connected socket comprises: 데이터의 수신측에서 수신할 수 있는 데이터의 최대크기를 상기 인터페이스모듈의 초기화 단계에서 미리 지정하여, 상기 지정된 최대크기만큼씩 데이터를 수신하는 것을 특징으로 하는 연결지향 소켓 인터페이스 구현방법.And specifying a maximum size of data that can be received at a receiving side of the data in the initialization step of the interface module, and receiving data by the specified maximum size.
KR1020000063835A 2000-10-30 2000-10-30 Method for materializing connection-oriented socket interface KR20020033219A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
KR1020000063835A KR20020033219A (en) 2000-10-30 2000-10-30 Method for materializing connection-oriented socket interface

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
KR1020000063835A KR20020033219A (en) 2000-10-30 2000-10-30 Method for materializing connection-oriented socket interface

Publications (1)

Publication Number Publication Date
KR20020033219A true KR20020033219A (en) 2002-05-06

Family

ID=19696021

Family Applications (1)

Application Number Title Priority Date Filing Date
KR1020000063835A KR20020033219A (en) 2000-10-30 2000-10-30 Method for materializing connection-oriented socket interface

Country Status (1)

Country Link
KR (1) KR20020033219A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR100451786B1 (en) * 2000-11-30 2004-10-08 엘지전자 주식회사 Automatic management method for socket of mobile communication system
KR100560752B1 (en) * 2004-07-21 2006-03-13 삼성전자주식회사 System for managing socket connection and method for checking of socket connection state
KR100677141B1 (en) * 2004-10-11 2007-02-02 삼성전자주식회사 Apparatus and Method for performing an one to one name-based socket-communication
KR100995025B1 (en) * 2002-12-09 2010-11-19 엘지전자 주식회사 method for connecting communication port between server and client

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR100451786B1 (en) * 2000-11-30 2004-10-08 엘지전자 주식회사 Automatic management method for socket of mobile communication system
KR100995025B1 (en) * 2002-12-09 2010-11-19 엘지전자 주식회사 method for connecting communication port between server and client
KR100560752B1 (en) * 2004-07-21 2006-03-13 삼성전자주식회사 System for managing socket connection and method for checking of socket connection state
KR100677141B1 (en) * 2004-10-11 2007-02-02 삼성전자주식회사 Apparatus and Method for performing an one to one name-based socket-communication

Similar Documents

Publication Publication Date Title
US6785380B2 (en) Network-centric self-administered call center with intelligent mobile agent terminals
US5625678A (en) Method and system for allowing switched voice and data communication among multiple application programs
EP0381365B1 (en) A system and method for interconnecting applications across different networks of data processing systems
US7080120B2 (en) System and method for collaborative processing of distributed applications
KR100686705B1 (en) Method and apparatus for providing multi-client support in a SIP-enabled terminal
US7519950B2 (en) Method and system for version negotiation of distributed objects
EP1401169A1 (en) Method and system using a Meta service selector for deploying services over a plurality of networks
JP2007508617A (en) Method and apparatus for providing access to persistent application sessions
WO2004082152A2 (en) Supporting the exchange of data by distributed applications
CN108390950A (en) A kind of information push method, device and equipment
JP2001507189A (en) Internet SS7 Gateway
US6401123B1 (en) Systems, methods and computer program products for employing presumptive negotiation in a data communications protocol
EP1088422B1 (en) A telecommunication controller messaging system
KR20020033219A (en) Method for materializing connection-oriented socket interface
US7568194B2 (en) Method and system for availability checking on distributed objects
CN105721278A (en) Question-answer mechanism based on instant communication
Cisco Configuring Protocol Translation
Cisco Protocol Translation
Cisco Protocol Translation
Cisco Protocol Translation
Cisco Protocol Translation
Cisco Configuring Protocol Translation
Cisco Configuring Protocol Translation
Cisco Configuring Protocol Translation
Cisco Configuring Protocol Translation

Legal Events

Date Code Title Description
N231 Notification of change of applicant
WITN Application deemed withdrawn, e.g. because no request for examination was filed or no examination fee was paid