JPH1055323A - Communication interface - Google Patents

Communication interface

Info

Publication number
JPH1055323A
JPH1055323A JP8211535A JP21153596A JPH1055323A JP H1055323 A JPH1055323 A JP H1055323A JP 8211535 A JP8211535 A JP 8211535A JP 21153596 A JP21153596 A JP 21153596A JP H1055323 A JPH1055323 A JP H1055323A
Authority
JP
Japan
Prior art keywords
data
packet
application program
received
request
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.)
Granted
Application number
JP8211535A
Other languages
Japanese (ja)
Other versions
JP3439037B2 (en
Inventor
Hiroyuki Komiya
宏之 小宮
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.)
Sanyo Electric Co Ltd
Original Assignee
Sanyo Electric 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 Sanyo Electric Co Ltd filed Critical Sanyo Electric Co Ltd
Priority to JP21153596A priority Critical patent/JP3439037B2/en
Publication of JPH1055323A publication Critical patent/JPH1055323A/en
Application granted granted Critical
Publication of JP3439037B2 publication Critical patent/JP3439037B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Landscapes

  • Computer And Data Communications (AREA)
  • Communication Control (AREA)

Abstract

PROBLEM TO BE SOLVED: To release a process from a complicated reception processing and also to reduce a load of a main CPU by receiving the data on a condition described on a table in response to a reception request given from an application program and sending the received data back to the application program. SOLUTION: A LAN connection is secured via an Ethernet circuit 86 between a host computer 80 containing a communication interface 87 and another host computer. An application program request processing part 81 of the computer 80 receives a request from an application program 85 that desires to perform a communication. A protocol processing part 82 carries out a TCP/IP protocol to transmit and receive data to and from the opposite host computer, and a data transmitter/receiver means 83 transmits and receives data to and from the circuit 86. Then the part 81 notifies the part 82 of the time-out value and the packet size according to the contents of a parameter table 90 and also requests the communication processing.

Description

【発明の詳細な説明】DETAILED DESCRIPTION OF THE INVENTION

【0001】[0001]

【発明の属する技術分野】本発明は、情報処理装置に係
り、特に、他の情報処理装置とパケット通信を行う際、
通信プロトコルを処理する通信制御装置の機能を拡張し
て、アプリケーションプログラムにサービスを提供する
方法に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to an information processing apparatus, and more particularly, to performing packet communication with another information processing apparatus.
The present invention relates to a method for providing a service to an application program by extending a function of a communication control device that processes a communication protocol.

【0002】[0002]

【従来の技術】通信回線の仕様としてイーサネットを用
い、通信プロトコルにTCP/IPを使ったクライアン
ト/サーバ型LANが普及している。OSにUNIXを
使う情報機器の場合、例えばそれがサーバの機能を果た
すのであれば、クライアントからの接続要求を受け付け
る準備として通信チャネルをオープンし、あるウエルノ
ウンアドレスにおいてクライアントからの要求が来るの
を待つ。一方、クライアントは、通信チャネルをオープ
ンしてある特定のホスト即ちサーバのウエルノウンアド
レスに接続し、しかる後、サーバにサービスの要求を送
り、応答を受け取る。クライアントとサーバがお互いの
通信チャネルを認識して結んだ論理的な通信路をコネク
ションと呼び、このようにコネクションを確立してから
行う通信をコネクション型の通信と呼ぶ。TCPはコネ
クション型の通信を行うプロトコルである。また、TC
P/IPを採用する情報機器では、OSがUNIXでな
くともほぼ同じ様に、上述した手順で通信を行ってい
る。
2. Description of the Related Art A client / server type LAN using Ethernet as a communication line specification and using TCP / IP as a communication protocol has become widespread. In the case of an information device that uses UNIX for the OS, for example, if it performs the function of a server, a communication channel is opened in preparation for accepting a connection request from a client, and a request from the client is received at a certain well-known address. wait. On the other hand, the client opens a communication channel and connects to a specific host, that is, the well-known address of the server, and then sends a service request to the server and receives a response. A logical communication path in which the client and the server recognize each other's communication channel and connect them is called a connection, and communication performed after establishing such a connection is called connection-type communication. TCP is a protocol for performing connection-type communication. Also, TC
Information devices employing P / IP perform communication in the same manner as described above, even if the OS is not UNIX.

【0003】そして、クライアントにおいて通信を行お
うとするプロセスは、送るべきデータが入ったバッファ
をTCPに引き渡す。TCPはそのデータにTCPヘッ
ダを付加して下層のIPに引き渡す。IPはさらにIP
ヘッダを付加してIPパケットとし、下層のデータリン
ク層に引き渡すので、データリンク層ではイーサネット
の規約に従ってデータを送受する。
[0005] A process that attempts to communicate at a client hands over a buffer containing data to be sent to TCP. TCP adds a TCP header to the data and delivers the data to the lower layer IP. IP is more IP
Since a header is added to form an IP packet and delivered to the lower data link layer, the data link layer transmits / receives data in accordance with the rules of Ethernet.

【0004】尚、本明細書では、IPが相手ホストのI
Pと送受するデータをIPパケット又はデータグラムと
呼び、TCPが相手ホストのTCPと送受するデータを
単にパケットと呼ぶことにする。
[0004] In this specification, the IP is the IP address of the partner host.
Data transmitted / received from / to P is referred to as an IP packet or datagram, and data transmitted / received from / to TCP of the partner host is simply referred to as a packet.

【0005】[0005]

【発明が解決しようとする課題】TCPは、パケットの
破壊や消失について保証している。しかし、パケットサ
イズの制約や通信速度の制約から、下層のIPは一つの
パケットを複数に分割して送受することもあるので、そ
れを渡されたTCPは、プロセスが求めるサイズのデー
タを一度に上位プロセスに引き渡すところまでは保証し
ていない。そのため、TCPを使って通信を行おうとす
るプロセスは、所望サイズのデータを受け取るまで何度
もTCPに受信要求を繰り返す必要があった。また、非
同期で送られてくるパケットを効率よく受け取るために
は、周期的に受信要求を出して常にパケットを取り込む
ようにする必要があった。この為、プログラムの構成が
複雑になるとともに、そのプロセスがCPUを独占しが
ちになる弊害もあった。
The TCP guarantees the destruction or loss of a packet. However, due to restrictions on packet size and communication speed, the lower layer IP may divide one packet into a plurality of packets and send / receive them. It does not guarantee that it will be passed to a higher-level process. Therefore, a process that attempts to perform communication using TCP needs to repeat a reception request to TCP many times until data of a desired size is received. Also, in order to efficiently receive packets sent asynchronously, it is necessary to periodically issue a reception request and always take in packets. For this reason, the configuration of the program becomes complicated, and the process tends to monopolize the CPU.

【0006】さらに、クライアントプロセスが受け取る
パケットは、必ずしもクライアントにとって既知のサイ
ズであるとは限らない。例えば、STX(16進数で0
2、以下02Hと表記)で始まるデータ列は、その最終
バイトがETX(03H)で終端する場合、データのサ
イズは送り側が決定するので受け側にとっては不定であ
る。従って、クライアントプロセスは常に最大サイズで
パケットの受信を要求するか、逆に小さなサイズで受信
要求しておいて受信したパケット毎に最終バイトを検査
する必要があった。前者の場合、サーバプロセスが最大
サイズに満たないデータしか送ってこなかったとき、ク
ライアントプロセスはいつまでも待たされる事態も生じ
かねない。また、後者の場合、頻繁に受信要求を繰り返
すことになり、前述したような問題が発生する。
[0006] Further, the packets received by the client process are not necessarily of a known size to the client. For example, STX (0 in hexadecimal)
2, the data string starting with 02H) is indeterminate for the receiving side because the size of the data is determined by the transmitting side when the last byte ends with ETX (03H). Therefore, the client process must always request reception of a packet with the maximum size, or conversely, request reception with a small size and check the last byte for each packet received. In the former case, when the server process sends data less than the maximum size, the client process may wait forever. In the latter case, the reception request is frequently repeated, and the above-described problem occurs.

【0007】本願は、パケット通信に伴う複雑な受信処
理からプロセスを開放し、且つ、効率的な受信を可能に
してメインCPUの負荷を低減することを目的とする。
An object of the present invention is to relieve the process from complicated reception processing associated with packet communication and to enable efficient reception to reduce the load on the main CPU.

【0008】[0008]

【課題を解決するための手段】本発明は、相手装置とデ
ータの送受信を行うプロトコル処理手段と、アプリケー
ションプログラムからの要求に応じて前記プロトコル処
理手段に通信処理を要求する要求処理手段とを有する通
信インターフェースであって、相手装置とのデータの送
受信に関するユーザが変更可能な条件を記述したテーブ
ルを備え、前記要求処理手段は、前記テーブルに記述さ
れた条件に基づいて前記プロトコル処理手段に通信処理
を要求するようにし、アプリケーションプログラムから
の1回の受信要求に応じて前記テーブルに記述された条
件のデータを受信して前記アプリケーションプログラム
にその受信データを返すようにして、上記課題を解決す
るものである。
The present invention comprises a protocol processing unit for transmitting and receiving data to and from a partner device, and a request processing unit for requesting the protocol processing unit to perform communication processing in response to a request from an application program. A communication interface, comprising: a table describing conditions that can be changed by a user with respect to transmission / reception of data to / from a partner device, wherein the request processing unit communicates with the protocol processing unit based on the conditions described in the table. And receiving the data of the conditions described in the table in response to one reception request from the application program and returning the reception data to the application program, thereby solving the above-mentioned problem. It is.

【0009】[0009]

【実施例】図8は、本願発明の通信インターフェース87
を備えた計算機80(以下、ホストと呼ぶ)の機能ブロッ
ク図である。このホスト80は、イーサネット回線86を介
して他のホストコンピュータとLAN接続されている。
ホスト同士は相互にクライアントにもサーバにもなるこ
とが出来るが、本実施例では設定によってそのホストが
クライアントとして動作するか、サーバとして動作する
かを予めユーザが決めておく構成である。
FIG. 8 shows a communication interface 87 of the present invention.
FIG. 2 is a functional block diagram of a computer 80 (hereinafter, referred to as a host) including a host. The host 80 is connected to another host computer via an Ethernet line 86 via a LAN.
The hosts can be both a client and a server. However, in this embodiment, the user determines in advance whether the host operates as a client or a server according to settings.

【0010】図に示すように、ホスト80には、通信を行
おうとするアプリケーションプログラム85からの要求を
受け付けるアプリケーションプログラム要求処理部81
と、TCP/IPプロトコルを実行して相手ホストとデ
ータを送受するプロトコル処理部82と、イーサネットの
規約に従って実際に物理的にデータをイーサネット回線
86に送信し、また受信するデータ送受信手段83と、通信
に関するパラメータを記憶するパラメータテーブル90と
がある。
As shown in FIG. 1, a host 80 has an application program request processing unit 81 for receiving a request from an application program 85 for performing communication.
A protocol processing unit 82 that executes a TCP / IP protocol to transmit / receive data to / from a partner host;
86 includes a data transmitting / receiving means 83 for transmitting and receiving data, and a parameter table 90 for storing parameters relating to communication.

【0011】そして、アプリケーションプログラム要求
処理部81は、そのパラメータテーブル90の内容に応じて
プロトコル処理部82に対し、後述するタイムアウト値や
パケットサイズを通知するとともに、通信処理を要求す
る。また、プロトコル処理部82は通信時間を計測するた
めの計時手段84を備えていて、指定されたサイズのパケ
ット受信時だけでなく、設定された時間の経過時にも、
上位のアプリケーションプログラム要求処理部81に通知
するようにしている。ここでは、設定時間が経過するこ
とをタイムアウトと呼ぶことにする。また、アプリケー
ションプログラム85のことを、以下、プロセスと呼ぶ場
合もある。
The application program request processing unit 81 notifies the protocol processing unit 82 of a timeout value and a packet size, which will be described later, according to the contents of the parameter table 90, and requests communication processing. Further, the protocol processing unit 82 includes a timer 84 for measuring the communication time, and not only when a packet of a specified size is received, but also when a set time elapses.
The upper-level application program request processing unit 81 is notified. Here, the elapse of the set time is called a timeout. Further, the application program 85 may be hereinafter referred to as a process.

【0012】図9はパラメータテーブル90の内容を示
し、C/Sモード91はそのホストがクライアントのモー
ドで動作するか、サーバのモードで動作するかを示すフ
ラグである。ホスト名92はそのホストがクライアントモ
ードで動作する場合に接続すべきサーバの名前である。
サーバが複数存在する場合には、アプリケーションプロ
グラム85から直接指示されたサーバ名を優先させること
ができる。接続時タイムアウト値93は、クライアントの
アプリケーションプログラム要求処理部81がホストとの
通信を要求され、通信チャネルをオープンしてサーバに
コネクションを要求した後、サーバから応答が返るまで
の最大の待ち時間である。つまり、クライアント/サー
バ間のコネクションを確立する為に使える最大許容時間
である。
FIG. 9 shows the contents of the parameter table 90. The C / S mode 91 is a flag indicating whether the host operates in the client mode or the server mode. The host name 92 is the name of a server to be connected when the host operates in the client mode.
When there are a plurality of servers, the server name specified directly by the application program 85 can be prioritized. The connection time-out value 93 is the maximum wait time from when the application program request processing unit 81 of the client requests communication with the host, opens a communication channel and requests a connection to the server, and returns a response from the server. is there. That is, it is the maximum allowable time that can be used to establish a connection between the client and the server.

【0013】受信時タイムアウト値94は、クライアント
からサーバに対してデータの送信を要求したとき、要求
を送ってから最初のデータグラムを受信するまでの待ち
時間の最大値である。また、パケットタイムアウト値95
は、最初のデータグラムを受信してからそのデータグラ
ムを含む完全なパケットを受信するまでの時間を規定す
る。完全なパケットとは、後述する条件に該当するパケ
ットであって、指定されたサイズのバイトデータを有す
るパケットである。
The reception time-out value 94 is the maximum value of the waiting time from when the client sends a request to the server to transmit data until the first datagram is received after the request is sent. Also, the packet timeout value 95
Specifies the time between receiving the first datagram and receiving the complete packet containing the datagram. A complete packet is a packet that satisfies the conditions described below and that has byte data of a specified size.

【0014】本実施例ではパラメータテーブル90のこと
をプロトコルアジャストテーブルと呼び、以下PATと
略称する。図10は、上記パラメータを設定するための
基本仕様設定画面10の表示例である。モード11はクライ
アントなら「1」を、サーバーなら「2」を設定する。
接続ホスト名12は既知のサーバ名を設定する。この例で
は「NET-HOST」がサーバ名である。接続タイムアウト13
と受信タイムアウト14及び1パケットの受信時間15は、
何れも0.1秒から600秒の範囲で設定が可能であ
る。そのうち1パケットの受信時間15は、受信処理の効
率を考えて数秒以下に設定するのがよい。
In the present embodiment, the parameter table 90 is called a protocol adjustment table, and is abbreviated as PAT hereinafter. FIG. 10 is a display example of a basic specification setting screen 10 for setting the above parameters. In mode 11, "1" is set for a client and "2" is set for a server.
As the connection host name 12, a known server name is set. In this example, "NET-HOST" is the server name. Connection timeout 13
And the reception timeout 14 and the reception time 15 of one packet are
Any of them can be set within a range of 0.1 second to 600 seconds. The reception time 15 of one packet is preferably set to several seconds or less in consideration of the efficiency of the reception process.

【0015】図9に戻って、先頭データ96乃至最大サイ
ズ99は受信するパケットの条件を指定する。即ち、受信
したパケットの先頭のバイトデータが、先頭データ96に
示されたバイトデータに一致する場合、そのパケットの
サイズ(本実施例ではバイト数)は、最大サイズ99で示
された大きさが期待されることを示している。又は、そ
のパケットの最後尾のデータが末尾データ(1)97また
は末尾データ(2)98に一致すれば、最大サイズ99によ
らずそのパケットは完成したことを示すものである。従
って、最大サイズ99に一致しないパケットであっても、
先頭と末尾のデータが条件を満たせば、前に述べた完全
なパケットとして扱い得ることを指示するものである。
Returning to FIG. 9, the head data 96 to the maximum size 99 specify the conditions of the packet to be received. That is, when the first byte data of the received packet matches the byte data indicated by the first data 96, the size of the packet (the number of bytes in this embodiment) is equal to the size indicated by the maximum size 99. It shows what is expected. Alternatively, if the last data of the packet matches the last data (1) 97 or the last data (2) 98, this indicates that the packet is completed regardless of the maximum size 99. Therefore, even if the packet does not match the maximum size of 99,
If the data at the beginning and end satisfy the conditions, it indicates that the packet can be treated as a complete packet as described above.

【0016】図11は、これら条件を設定する受信仕様
設定画面20の表示例である。先頭データ21から最大サイ
ズ24迄の4個の条件の組み合わせを10組まで登録する
ことができる。例えば、符号25で示す組みは、先頭デ
ータ21が02H即ちSTX、末尾データ(1)22が03
H即ちETX、そして、最大サイズ24が1024バイト
のパケットを規定している。これは、受信したデータグ
ラムの先頭バイトがSTXであるとき、最後尾のデータ
がETXであるか、又は、受信したデータが全部で10
24バイトになったとき、そのパケットは完成したもの
として上位のプロセス85に引き渡すことを指示するもの
である。
FIG. 11 is a display example of a reception specification setting screen 20 for setting these conditions. Up to ten combinations of four conditions from the first data 21 to the maximum size 24 can be registered. For example, in the set indicated by reference numeral 25, the first data 21 is 02H, that is, STX, and the last data (1) 22 is 03.
H, that is, ETX, and a packet having a maximum size 24 of 1024 bytes. This is because when the first byte of the received datagram is STX, when the last data is ETX, or when the received data is 10
When it becomes 24 bytes, it indicates that the packet is to be delivered to the upper process 85 as completed.

【0017】また、符号26で示す組みは、先頭データ
21がENQの場合で、これは1バイトで意味を成すデー
タなので最大サイズ24は1バイト、末尾データは設定無
しである。つまり、ENQを受信したなら直ちにその1
バイトを上位のプロセス85に引き渡すことを指示するも
のである。
The set indicated by reference numeral 26 is the first data
21 is the case of ENQ, which is data meaningful in one byte, so the maximum size 24 is one byte, and the end data is not set. In other words, if ENQ is received, immediately
This indicates that the byte is to be transferred to the upper process 85.

【0018】また、符号27で示す組みは、先頭データ
21は何でもよいが末尾のデータがCRまたはLFである
とき、上位プロセス85にそのパケットを引き渡すことを
指示するものである。この場合も、CR又はLFが来る
前に130バイトのデータを受信したならば、その時点
でパケットを引き渡すことを指示している。このように
本実施例では、先頭データとして「**」を総称的な指
定を表わす文字、所謂ワイルドカード文字として使用可
能である。
The set indicated by reference numeral 27 is the first data
Numeral 21 indicates that the packet is delivered to the upper process 85 when the data at the end is CR or LF. Also in this case, if 130-byte data is received before the CR or LF comes, it indicates that the packet should be delivered at that point. As described above, in this embodiment, "**" can be used as a character representing a generic designation, that is, a so-called wild card character, as the leading data.

【0019】尚、その他のデータとして、最大サイズ24
だけを1024バイトに指定したパケットを予め規定し
ている。これは、符号27で示す様な条件をPAT90内
にユーザが設定しなかった場合に有効である。
As other data, a maximum size of 24
Is specified in advance as a 1024-byte packet. This is effective when the user does not set the condition indicated by reference numeral 27 in the PAT90.

【0020】図10及び図11に示した画面は、通信条
件を設定するための図8に示すアプリケーションプログ
ラム85によって表示される。そして、ユーザが画面上で
設定した値がPAT90に反映されるようになっている。
アプリケーションプログラム要求処理部81はPAT90を
参照し、その条件に基づいてプロトコル処理部82に通信
条件を指定し、処理を依頼する。
The screens shown in FIGS. 10 and 11 are displayed by an application program 85 shown in FIG. 8 for setting communication conditions. The value set on the screen by the user is reflected on the PAT90.
The application program request processing unit 81 refers to the PAT 90, specifies communication conditions to the protocol processing unit 82 based on the conditions, and requests processing.

【0021】次に、図1乃至図7の流れ図を参照しなが
ら、実施例の動作を説明する。アプリケーションプログ
ラム要求処理部81は、アプリケーションプログラム85
(上位プロセス)からシステムコールの形で通信の開始
や、データの送信、受信の指示を受け、次のように動作
する。<コネクションの確立>アプリケーションプログ
ラム要求処理部81は、次のようにしてサーバとのコネク
ションを確立する。
Next, the operation of the embodiment will be described with reference to the flowcharts of FIGS. The application program request processing unit 81 includes an application program 85
Upon receiving an instruction to start communication, transmit or receive data in the form of a system call from the (upper process), the following operation is performed. <Establishment of Connection> The application program request processing unit 81 establishes a connection with the server as follows.

【0022】即ち、図1(a)に示すように、先ずPA
T90からパラメータを読み出して自身のメモリに写し
(ステップS101)、プロトコル処理部82に対して通信ポ
ートの確保を要求して(同S102)応答を待つ。同時に、
呼び出しを行ったプロセス85をブロックしてスリープ状
態とし、他のプロセス85に制御を譲渡する。一方、プロ
トコル処理部82は、通信ポート(ソケット)を確保して
その結果を返す。
That is, as shown in FIG.
The parameters are read from T90 and copied to its own memory (step S101), and a request for securing a communication port is made to the protocol processing unit 82 (step S102), and a response is waited. at the same time,
The calling process 85 is put into a sleep state by blocking, and the control is transferred to another process 85. On the other hand, the protocol processing unit 82 secures a communication port (socket) and returns the result.

【0023】図1(b)に示すように、プロトコル処理
部82の応答から、アプリケーションプログラム要求処理
部81はソケットが確保できたか否かを判断し、確保でき
なかった場合(同S103;No)、上位プロセス85に対して
その旨エラーを返す。一方、ソケットを確保できた場合
は、PAT90に定義された接続タイムアウト値をプロト
コル処理部82に送って設定し(同S104)、同じくPAT
90に定義されたホスト名92を持つサーバとのコネクショ
ンを要求して(同S105)応答を待つ。プロトコル処理部
82は、内部の計時手段84を用いて計時し、先に設定され
た接続タイムアウト値の範囲内でサーバとのコネクショ
ンの確立を試み、その結果を返す。
As shown in FIG. 1B, from the response of the protocol processing unit 82, the application program request processing unit 81 determines whether or not the socket has been secured, and if the socket has not been secured (No in S103). , An error is returned to the upper process 85. On the other hand, if the socket can be secured, the connection timeout value defined in the PAT 90 is sent to the protocol processing unit 82 and set (S104), and the PAT is also set.
Requests a connection with the server having the host name 92 defined in 90 (S105) and waits for a response. Protocol processing unit
82 measures the time using the internal clock means 84, attempts to establish a connection with the server within the previously set connection timeout value, and returns the result.

【0024】図1(c)に示すように、アプリケーショ
ンプログラム要求処理部81はプロトコル処理部82の応答
がタイムアウトか否かを判断し(同S106)、タイムアウ
トの場合、上位プロセス85に対してその旨エラーを返
す。一方、タイムアウトでない場合は、コネクションが
確立したか否かを判断し(同S107)、確立していなけれ
ば上位プロセス85に対してその旨エラーを返す。コネク
ションが確立していれば正常終了して上位プロセス85に
制御を返す。
As shown in FIG. 1C, the application program request processing section 81 determines whether or not the response from the protocol processing section 82 has timed out (S106). Error is returned. On the other hand, if it is not time-out, it is determined whether or not a connection has been established (S107). If not, an error is returned to the upper process 85 to that effect. If the connection is established, the process ends normally and returns control to the upper process 85.

【0025】尚、サーバは、システム起動時に図7に示
す処理を実行して、常にクライアントからの接続要求を
受け付けられるようにしている。即ち、通信ポートを確
保し(同S701)、確保できたならば(同S702;Yes)、ク
ライアントの接続要求を受け付ける(同S703)。UNI
Xマシンであれば、これは通常、accept()システムコー
ルで終了する。 <データの受信>アプリケーションプログラム要求処理
部81は、次のようにしてサーバからのデータを受信す
る。
Note that the server executes the processing shown in FIG. 7 when the system is started, so that a connection request from a client can always be accepted. That is, a communication port is secured (S701), and if it is secured (S702; Yes), a client connection request is accepted (S703). UNI
For X machines, this usually ends with an accept () system call. <Reception of Data> The application program request processing unit 81 receives data from the server as follows.

【0026】即ち、図2に示すように、先ず、PAT90
に記述された受信タイムアウト値をプロトコル処理部82
に送って設定する(同S201)。そして本実施例では、何
でもよいからデータを受信したならばその先頭バイトを
返すように、1バイトの受信をプロトコル処理部82に要
求する(同S203)。
That is, as shown in FIG.
The reception timeout value described in
(S201). Then, in this embodiment, if any data is received, it requests the protocol processing unit 82 to receive one byte so that the first byte is returned if the data is received (S203).

【0027】但し、上位プロセス85から受信バイト数を
明示して呼び出しを受けた場合には、ステップS202
から端子Aに進み、図5に示すように、指定されたバイ
ト数のデータの受信を要求し(同S501)、応答を待つ。
このように、上位プロセス85が求めるバイト数の受信デ
ータを返すように、プロトコル処理部82に要求するのが
従来のやり方である。しかし、本願発明では、最初に受
信したデータグラムの先頭の1バイトが何であるかを知
るために、先ず1バイトのデータを返すようにプロトコ
ル処理部82に要求するのである。
However, if a call is received from the upper process 85 specifying the number of received bytes, step S202
Then, the process proceeds to terminal A, as shown in FIG. 5, and requests reception of data of a designated number of bytes (S501), and waits for a response.
In this manner, the conventional method requests the protocol processing unit 82 to return the received data of the number of bytes required by the upper process 85. However, according to the present invention, the protocol processing unit 82 is first requested to return one byte of data in order to know what is the first byte of the datagram received first.

【0028】以下、1バイトの受信を要求した場合の動
作を説明する。プロトコル処理部82は、内部の計時手段
84を用いて計時し、先に設定された受信タイムアウト値
の範囲内でデータグラムの到着を待ち、その結果を返
す。即ち、データグラムが到着すればその先頭の1バイ
トを返し、そうでなければタイムアウトのエラーを返
す。
The operation when requesting reception of one byte will be described below. The protocol processing unit 82 has an internal clock
Time is counted using 84, wait for the datagram to arrive within the previously set reception timeout value, and return the result. That is, if a datagram arrives, the first byte of the datagram is returned; otherwise, a timeout error is returned.

【0029】図3に示すように、アプリケーションプロ
グラム要求処理部81はプロトコル処理部82の応答がタイ
ムアウトか否かを判断し(同S301)、タイムアウトの場
合、上位プロセス85に対してその旨エラーを返す。一
方、タイムアウトでない場合は、受け取った1バイトの
データによってPAT90の先頭データを検索し、対応す
る末尾データと最大サイズを取得する(同S302)。図1
1の例でいくと、プロトコル処理部82から受け取った1
バイトがSTXならば、末尾データはETX、最大サイ
ズは1024である。また、先頭データがENQならば
末尾データは指定無しで、最大サイズは1である。それ
以外のデータが先頭データの場合はすべて、末尾データ
はCRまたはLFで、最大サイズが130である。
As shown in FIG. 3, the application program request processing section 81 determines whether or not the response from the protocol processing section 82 has timed out (S301). return. On the other hand, if it is not time-out, the head data of the PAT90 is searched by the received 1-byte data, and the corresponding tail data and the maximum size are obtained (S302). FIG.
In the example of 1, the 1 received from the protocol processing unit 82
If the byte is STX, the end data is ETX and the maximum size is 1024. If the first data is ENQ, the last data is not specified, and the maximum size is 1. In all cases where the other data is the leading data, the trailing data is CR or LF and the maximum size is 130.

【0030】そこで、アプリケーションプログラム要求
処理部81は、既に取得済みの先頭1バイトを最大サイズ
から差し引いて残りのサイズを計算する(同S303)。そ
の結果、残りサイズが0ならば(同S304;Yes)、データ
の受信は終了なので受信パケットを上位プロセス85に返
して正常終了する。例えば、受信データがENQなら
ば、その1バイトを返して直ちに終了するのである。
Therefore, the application program request processing unit 81 calculates the remaining size by subtracting the first byte already obtained from the maximum size (S303). As a result, if the remaining size is 0 (S304; Yes), the data reception has been completed, so the received packet is returned to the upper process 85, and the process ends normally. For example, if the received data is ENQ, one byte is returned and the process immediately ends.

【0031】一方、残りサイズが0でなければ(同S30
4;No)、引き続いて送られてくるはずの残りのデータ
を受信するために、プロトコル処理部82に先ずタイムア
ウト値100msを設定し(同S305)、PAT90のパケ
ットタイムアウト値95からその100msを減算してお
く(同S306)。そして、残りサイズを指定してデータの
受信をプロトコル処理部82に要求する(同S307)。この
100msという値は、先頭の1バイトを既に受信して
いるということから、最初のデータグラムは到着済みで
あると考えられるので、2バイト目以降の残りのデータ
を早めに取り込むために、短めに設定している。
On the other hand, if the remaining size is not 0 (S30)
4; No), a timeout value of 100 ms is first set in the protocol processing unit 82 in order to receive the remaining data to be sent subsequently (S305), and the 100 ms is subtracted from the packet timeout value 95 of the PAT90. (S306). Then, it specifies the remaining size and requests the protocol processing unit 82 to receive data (S307). Since the first datagram is considered to have arrived since the first byte has already been received, the value of 100 ms is set to a shorter value to capture the remaining data after the second byte. Is set to

【0032】図11に示す例では、先頭データ21がST
Xの場合、パケットの最大サイズ24は1024バイトで
あるが、最初のデータグラムの末尾データがETXであ
れば、1024バイトの到着を待たずに上位プロセス85
に受信パケットを返すことができる。そこで、先頭1バ
イトを受信した直後は、短めのタイムアウト値ですぐに
結果を上位プロセス85に返せるようにしているのであ
る。
In the example shown in FIG.
In the case of X, the maximum size 24 of the packet is 1024 bytes, but if the end data of the first datagram is ETX, the upper process 85 does not wait for the arrival of 1024 bytes.
Can return the received packet. Therefore, immediately after the first byte is received, the result can be immediately returned to the upper process 85 with a shorter timeout value.

【0033】図4は2バイト目以降の受信処理を示して
いる。上で述べたように、プロトコル処理部82は、10
0ms経過するとその時点で受信済みのデータグラムを
返すので、アプリケーションプログラム要求処理部81
は、受信データが有れば(ステップS401;Yes)、その末
尾のバイトデータが末尾データ(1)97又は(2)98と
一致するか比較する(同S402)。一致すればそのパケッ
トは完成なのでそれを上位プロセス85に返して正常終了
する。一方、末尾データ(1)97又は(2)98のいずれ
とも一致しなかった場合(同S403;No )、今回受け取っ
たデータグラムのバイト数を残りサイズから差し引いて
残りサイズを再計算する(同S404)。その結果、残りサ
イズが0ならば、所定サイズのデータの受信は終了なの
で、受信パケットを上位プロセス85に返して正常終了す
る。
FIG. 4 shows the receiving process for the second and subsequent bytes. As described above, the protocol processing unit 82
When 0 ms has elapsed, the datagram that has been received at that time is returned.
If there is received data (Step S401; Yes), the end byte data is compared with the end data (1) 97 or (2) 98 to determine whether it matches (S402). If they match, the packet is completed, so it is returned to the upper process 85 and the process ends normally. On the other hand, if it does not match any of the end data (1) 97 or (2) 98 (S403; No), the remaining size is recalculated by subtracting the number of bytes of the datagram received this time from the remaining size (S403). S404). As a result, if the remaining size is 0, the reception of the data of the predetermined size is completed, so the received packet is returned to the upper process 85, and the process ends normally.

【0034】一方、残りサイズが0でなければ、PAT
90のパケットタイムアウト値95の残りが0以上か否か検
査する(同S406)。もし0であれば、設定時間内に完全
なパケットが受信できなかったということなので、現在
受信済みのデータを上位プロセス85に返すとともにタイ
ムアウトエラーを通知する。PAT90のパケットタイム
アウト値95の残りが0以上であれば(同S406;Yes)、引
き続いて送られてくるはずの残りのデータを受信するた
めに、プロトコル処理部82に今度はタイムアウト値30
0msを設定し(同S407)、PAT90のパケットタイム
アウト値95からその300msを減算しておく(同S40
8)。そして、残りサイズを指定してデータの受信をプ
ロトコル処理部82に要求する(同S409)。この要求に対
するプロトコル処理部82からの応答があったときは、ア
プリケーションプログラム要求処理部81は再びステップ
S401から処理を再開するようになっている。
On the other hand, if the remaining size is not 0, PAT
It is checked whether the remainder of the 90 packet timeout value 95 is 0 or more (S406). If 0, it means that a complete packet could not be received within the set time, so the currently received data is returned to the upper process 85 and a timeout error is notified. If the remainder of the packet timeout value 95 of the PAT 90 is equal to or greater than 0 (S406; Yes), the protocol processing unit 82 instructs the protocol processing unit 82 to receive the timeout value 30 in order to receive the remaining data to be sent subsequently.
0 ms is set (S407), and the 300 ms is subtracted from the packet timeout value 95 of the PAT90 (S40).
8). Then, it specifies the remaining size and requests the protocol processing unit 82 to receive data (S409). When there is a response to this request from the protocol processing unit 82, the application program request processing unit 81 resumes the process from step S401.

【0035】尚、ステップS401で受信データが無し
の場合、同S406に跳んでパケットタイムアウトの検
査を実行する。そして、その際、プロトコル処理部82に
タイムアウト値として300msを設定している。これ
は、最初のデータグラム受信でパケットが完成しなかっ
たことから、パケットが二つ以上に分割されていること
は明らかなので、送信側の処理時間を考えて、図3に示
した初回の設定値100msより大きくして、当該プロ
セスがCPUを独占しないように配慮している。
If there is no received data in step S401, the process jumps to step S406 to execute a packet timeout check. At this time, 300 ms is set as a timeout value in the protocol processing unit 82. This is because the packet was not completed in the first datagram reception, and it is clear that the packet is divided into two or more. Therefore, considering the processing time on the transmission side, the initial setting shown in FIG. The value is set to be longer than 100 ms so that the process does not monopolize the CPU.

【0036】以上説明したとおり、データの受信に際し
ては、アプリケーションプログラム85は受信要求を一回
発行すればよい。その一回の受信要求に応じて、アプリ
ケーションプログラム要求処理部81からは、PAT90に
定義された条件に一致するパケットを受信したときか、
同じくPAT90に定義された時間を経過してタイムアウ
トエラーになったときにアプリケーションプログラム85
に通知される。その間、PAT90に定義された条件やタ
イムアウトの検査は総べて、アプリケーションプログラ
ム要求処理部81とプロトコル処理部82が行うので、アプ
リケーションプログラム85は一切なにもしなくてもよ
い。
As described above, upon receiving data, the application program 85 may issue a reception request once. In response to the single reception request, the application program request processing unit 81 determines whether a packet matching the conditions defined in the PAT 90 has been received,
Similarly, when a time-out error occurs after the time defined in the PAT 90 has elapsed, the application program 85
Will be notified. During that time, the application program request processing unit 81 and the protocol processing unit 82 all check the conditions and timeouts defined in the PAT 90, so that the application program 85 does not need to do anything.

【0037】ところで、上位プロセス85が受信バイト数
を明示して受信要求した場合には、アプリケーションプ
ログラム要求処理部81は図5の処理の後、図6の処理を
実行する。これは図4に示した処理から、末尾バイトを
比較するステップS402と同S403を省略したもの
であり、それ以外の処理は全く一致する。
When the upper process 85 makes a reception request by explicitly indicating the number of received bytes, the application program request processing section 81 executes the processing of FIG. 6 after the processing of FIG. This is the same as the processing shown in FIG. 4 except that steps S402 and S403 for comparing the last byte are omitted, and the other processing is completely the same.

【0038】[0038]

【発明の効果】本発明によれば、アプリケーションプロ
グラム85は一回の受信要求だけで所望のパケットを受け
取ることができるので、処理が単純化でき、プログラム
作成が容易になる。又、所望のデータが送信されてこな
いときは、所定の時間でタイムアウトエラーとなって返
ってくるので、いつまでも待たされることがなく、それ
に応じた適切な対応をとることが可能になる。そして、
頻繁にパケットの到着を確認する必要が無いので、その
アプリケーションがCPUを独占することがなくなり、
システム全体の効率が向上する。
According to the present invention, since the application program 85 can receive a desired packet with only one reception request, the processing can be simplified and the program can be easily created. Further, when the desired data is not transmitted, a time-out error is returned in a predetermined time, so that an appropriate response can be taken without waiting forever. And
Since there is no need to frequently check the arrival of packets, the application will not monopolize the CPU,
The efficiency of the entire system is improved.

【図面の簡単な説明】[Brief description of the drawings]

【図1】実施例におけるクライアントの通信開始の処理
手順を示す流れ図である。
FIG. 1 is a flowchart illustrating a processing procedure for starting communication of a client in an embodiment.

【図2】実施例における1バイト受信指示の処理手順を
示す流れ図である。
FIG. 2 is a flowchart showing a processing procedure of a 1-byte reception instruction in the embodiment.

【図3】実施例における先頭1バイト受信後の処理手順
を示す流れ図である。
FIG. 3 is a flowchart showing a processing procedure after reception of a first byte in the embodiment.

【図4】実施例における2バイト目以降の受信処理の処
理手順を示す流れ図である。
FIG. 4 is a flowchart illustrating a processing procedure of reception processing of a second byte and subsequent bytes in the embodiment.

【図5】実施例における指定バイトの受信指示の処理手
順を示す流れ図である。
FIG. 5 is a flowchart illustrating a processing procedure of an instruction to receive a designated byte in the embodiment.

【図6】実施例における2バイト目以降の受信処理の処
理手順を示す流れ図である。
FIG. 6 is a flowchart illustrating a processing procedure of reception processing for a second byte and subsequent bytes in the embodiment.

【図7】実施例におけるサーバの通信開始処理の手順を
示す流れ図である。
FIG. 7 is a flowchart illustrating a procedure of a communication start process of a server in the embodiment.

【図8】実施例の通信インターフェースを含む情報処理
装置の構成を示すブロック図である。
FIG. 8 is a block diagram illustrating a configuration of an information processing apparatus including a communication interface according to the embodiment.

【図9】実施例におけるパラメータテーブルの構成例を
示す図である。
FIG. 9 is a diagram illustrating a configuration example of a parameter table in the embodiment.

【図10】実施例における基本仕様設定画面の表示例を
示す図である。
FIG. 10 is a diagram showing a display example of a basic specification setting screen in the embodiment.

【図11】実施例における受信仕様設定画面の表示例を
示す図である。
FIG. 11 is a diagram showing a display example of a reception specification setting screen in the embodiment.

【符号の説明】[Explanation of symbols]

10 基本仕様設定画面 20 受信仕様設定画面 80 情報機器 81 アプリケーションプログラム要求処理部 82 プロトコル処理部 83 データ送受信手段 84 計時手段 85 アプリケーションプログラム 86 イーサネット回線 87 通信インターフェース 90 パラメータテーブル 10 Basic specification setting screen 20 Reception specification setting screen 80 Information equipment 81 Application program request processing section 82 Protocol processing section 83 Data transmission / reception means 84 Clocking means 85 Application program 86 Ethernet line 87 Communication interface 90 Parameter table

Claims (7)

【特許請求の範囲】[Claims] 【請求項1】 相手装置とデータの送受信を行うプロト
コル処理手段と、アプリケーションプログラムからの要
求に応じて前記プロトコル処理手段に通信処理を要求す
る要求処理手段とを有する通信インターフェースであっ
て、相手装置とのデータの送受信に関するユーザが変更
可能な条件を記述したテーブルを備え、前記要求処理手
段は、前記テーブルに記述された条件に基づいて前記プ
ロトコル処理手段に通信処理を要求するようにし、アプ
リケーションプログラムからの1回の受信要求に応じて
前記テーブルに記述された条件のデータを受信して前記
アプリケーションプログラムにその受信データを返すよ
うにしたことを特徴とする通信インターフェース。
1. A communication interface comprising: a protocol processing unit for transmitting and receiving data to and from a partner device; and a request processing unit for requesting the protocol processing unit to perform a communication process in response to a request from an application program. An application program for requesting communication processing from the protocol processing means based on the conditions described in the table. A communication interface configured to receive data of a condition described in the table in response to one reception request from the server and return the received data to the application program.
【請求項2】 前記テーブルは、少なくとも1パケット
の受信時間を記述するものであり、前記要求処理手段
は、前記1パケットの受信時間より短い時間を指定して
前記プロトコル処理手段にデータの受信を繰り返し要求
し、前記プロトコル処理手段は計時手段を備え、前記要
求処理手段から指定された時間が経過すると、その時点
で受信済みのデータを返すようにしたことを特徴とする
請求項1記載の通信インターフェース。
2. The table describes at least the reception time of one packet, and the request processing means designates a time shorter than the reception time of the one packet and requests the protocol processing means to receive data. 2. The communication according to claim 1, wherein the request is repeated, and the protocol processing means includes a time measuring means, and when a time designated by the request processing means elapses, the data received at that time is returned. interface.
【請求項3】 前記テーブルにはさらに1パケットのサ
イズを記述するようにし、前記要求処理手段は、前記1
パケットの受信時間内に前記1パケットのサイズに等し
いデータを受信したならば、要求元のアプリケーション
プログラムにそのデータと共に肯定応答を返し、一方、
前記1パケットの受信時間内に前記1パケットのサイズ
に等しいデータを受信しなかったならば、要求元のアプ
リケーションプログラムにエラーを返すことを特徴とす
る請求項2記載の通信インターフェース。
3. The table further describes the size of one packet.
If data equal to the size of the one packet is received within the packet reception time, an acknowledgment is returned with the data to the requesting application program,
The communication interface according to claim 2, wherein an error is returned to the requesting application program if data equal to the size of the one packet is not received within the reception time of the one packet.
【請求項4】 前記テーブルにはさらに、パケットの先
頭データと末尾データとを記述可能にし、前記要求処理
手段は、前記1パケットの受信時間内に受信したデータ
の先頭と末尾のデータが共に前記テーブルに記述された
先頭データと末尾データにそれぞれ一致したとき、要求
元のアプリケーションプログラムにそのデータと共に肯
定応答を返し、一方、前記1パケットの受信時間内に一
致しなかったならば、要求元のアプリケーションプログ
ラムにエラーを返すようにしたことを特徴とする請求項
2記載の通信インターフェース。
4. The table may further describe start data and end data of a packet, and the request processing means may determine that both the start and end data of the data received within the reception time of the one packet are the same. When the header data matches the head data and the tail data described in the table, an acknowledgment is returned to the requesting application program together with the data. 3. The communication interface according to claim 2, wherein an error is returned to the application program.
【請求項5】 前記先頭データは、ワイルドカード文字
が使用可能であることを特徴とする請求項2記載の通信
インターフェース。
5. The communication interface according to claim 2, wherein a wildcard character can be used as the head data.
【請求項6】 前記要求処理手段は、前記1パケットの
受信時間内に、受信したデータの先頭と末尾のデータが
共に前記テーブルに記述された先頭データと末尾データ
にそれぞれ一致するか、又は、前記1パケットのサイズ
に等しいデータを受信したならば、要求元のアプリケー
ションプログラムに応答を返すようにしたことを特徴と
する請求項3乃至5記載の通信インターフェース。
6. The request processing means, wherein, within the reception time of the one packet, both the leading and trailing data of the received data match the leading and trailing data described in the table, respectively, or 6. The communication interface according to claim 3, wherein a response is returned to the requesting application program when data equal to the size of the one packet is received.
【請求項7】 前記プロトコル処理手段は、TCP/I
P手順を実行するものであることを特徴とする請求項1
乃至6記載の通信インターフェース。
7. The protocol processing means according to claim 1, wherein
2. The method according to claim 1, wherein a P procedure is performed.
7. The communication interface according to any one of claims 6 to 7.
JP21153596A 1996-08-09 1996-08-09 Communication interface Expired - Fee Related JP3439037B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP21153596A JP3439037B2 (en) 1996-08-09 1996-08-09 Communication interface

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP21153596A JP3439037B2 (en) 1996-08-09 1996-08-09 Communication interface

Publications (2)

Publication Number Publication Date
JPH1055323A true JPH1055323A (en) 1998-02-24
JP3439037B2 JP3439037B2 (en) 2003-08-25

Family

ID=16607479

Family Applications (1)

Application Number Title Priority Date Filing Date
JP21153596A Expired - Fee Related JP3439037B2 (en) 1996-08-09 1996-08-09 Communication interface

Country Status (1)

Country Link
JP (1) JP3439037B2 (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2008151016A2 (en) * 2007-06-01 2008-12-11 Microsoft Corporation Transporting table valued parameter over tabular data stream protocol
US9003054B2 (en) 2007-10-25 2015-04-07 Microsoft Technology Licensing, Llc Compressing null columns in rows of the tabular data stream protocol

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2008151016A2 (en) * 2007-06-01 2008-12-11 Microsoft Corporation Transporting table valued parameter over tabular data stream protocol
WO2008151016A3 (en) * 2007-06-01 2009-03-05 Microsoft Corp Transporting table valued parameter over tabular data stream protocol
US9003054B2 (en) 2007-10-25 2015-04-07 Microsoft Technology Licensing, Llc Compressing null columns in rows of the tabular data stream protocol

Also Published As

Publication number Publication date
JP3439037B2 (en) 2003-08-25

Similar Documents

Publication Publication Date Title
US6564267B1 (en) Network adapter with large frame transfer emulation
US6618360B1 (en) Method for testing data path of peripheral server devices
US7930349B2 (en) Method and apparatus for reducing host overhead in a socket server implementation
US9516114B2 (en) Data packet transmission method and related device and system
JP2001356973A (en) Network system
JP2003517688A (en) Method and apparatus for performing network operations
JPH0778112A (en) Network system and communication method for network
US8341453B2 (en) Transmission apparatus that transmits data according to a protocol, and method for measuring time in the transmission apparatus
CN110838935B (en) High-availability SDN controller clustering method, system, storage medium and equipment
US6765878B1 (en) Selective use of transmit complete interrupt delay on small sized packets in an ethernet controller
JP4432385B2 (en) Data relay system
JPH10308791A (en) Method and equipment for data communication and data communication program recording medium
EP1575236B1 (en) Connectivity confirmation method for network storage device and host computer
JPH1055323A (en) Communication interface
US7213074B2 (en) Method using receive and transmit protocol aware logic modules for confirming checksum values stored in network packet
Welzl et al. On the Usage of Transport Features Provided by IETF Transport Protocols
JP2000224260A (en) Communication controller
US7426589B2 (en) Network interface card for reducing the number of interrupts and method of generating interrupts
Cisco CMPC, CMPC+, and CSNA Commands
CN114697269A (en) Data communication method, apparatus, device and medium
Cisco Configuring Interfaces
JP2004094931A (en) Network system and communication method in network
JP2561033B2 (en) Packet relay system
JPH11275141A (en) Communication quality controller, network system, communication quality control method and recording medium
JPH04248735A (en) Communication control processing system

Legal Events

Date Code Title Description
FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20080613

Year of fee payment: 5

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20090613

Year of fee payment: 6

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20090613

Year of fee payment: 6

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20100613

Year of fee payment: 7

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20110613

Year of fee payment: 8

LAPS Cancellation because of no payment of annual fees