The UnixSock 구조
The UnixSock 구조
Unix 도메인 소켓을 만들고 다루는 연산을 제공하는 구조예요.
출처: 문서
본문
시놉시스 (Synopsis)
signature UNIX_SOCK (* OPTIONAL *)
structure UnixSock :> UNIX_SOCK (* OPTIONAL *)
인터페이스 (Interface)
type unix
type 'sock_type sock = (unix, 'sock_type) Socket.sock
type 'mode stream_sock = 'mode Socket.stream sock
type dgram_sock = Socket.dgram sock
type sock_addr = unix Socket.sock_addr
val unixAF : Socket.AF.addr_family
val toAddr : string -> sock_addr
val fromAddr : sock_addr -> string
structure Strm : sig
val socket : unit -> 'mode stream_sock
val socketPair : unit
-> 'mode stream_sock
* 'mode stream_sock
end
structure DGrm : sig
val socket : unit -> dgram_sock
val socketPair : unit -> dgram_sock * dgram_sock
end
설명 (Description)
type unix
AF_LOCAL(Unix) 주소 패밀리의 증인 타입이에요.
type 'sock_type sock = (unix, 'sock_type) Socket.sock
Unix 도메인 주소를 나타내는 타입이에요.
type 'mode stream_sock = 'mode Socket.stream sock
Unix 도메인 스트림·데이터그램 소켓을 만들어요.
type dgram_sock = Socket.dgram sock
경로로 주소를 만들고, 주소에서 경로를 얻어요.
type sock_addr = unix Socket.sock_addr
Unix 도메인 소켓 주소의 타입이에요.
val unixAF : Socket.AF.addr_family
Unix 주소 패밀리 값이에요.
toAddr s
경로명 s를 (Unix 주소 패밀리의) 소켓 주소로 변환해요. 경로 s의 유효성은 검사하지 않아요.
fromAddr addr
Unix 도메인 소켓 주소 addr에 대응하는 Unix 파일 시스템 경로를 돌려줘요.
structure Strm
val socket : unit -> 'mode stream_sock
이 함수는 Unix 주소 패밀리에서 스트림 소켓을 만들어요. 사용 중인 소켓이 너무 많으면 SysErr를 발생시켜요.
val socketPair : unit
-> 'mode stream_sock * 'mode stream_sock
이 함수는 Unix 주소 패밀리에서 이름 없는 연결된 스트림 소켓 쌍을 만들어요. 반환된 소켓들이 연결된다는 점에서 Posix.IO.pipe 함수와 비슷하지만, pipe와 달리 소켓들은 양방향이에요. 사용 중인 소켓이 너무 많으면 SysErr를 발생시켜요.
structure DGrm
val socket : unit -> dgram_sock
이 함수는 Unix 주소 패밀리에서 데이터그램 소켓을 만들어요. 사용 중인 소켓이 너무 많으면 SysErr를 발생시켜요.
val socketPair : unit -> dgram_sock * dgram_sock
이 함수는 Unix 주소 패밀리에서 이름 없는 연결된 데이터그램 소켓 쌍을 만들어요. 사용 중인 소켓이 너무 많으면 SysErr를 발생시켜요.## 더 알아보기 (Learn more)
- [ Top | Parent | Contents | Index | Root ] Generated April 12
- 2004 Last Modified June 5
- 1998 Comments to John Reppy. This document may be distributed freely over the internet as long as the copyright notice and license terms below are prominently displayed within every machine-readable copy. Copyright © 2004 AT&T and Lucent Technologies. All rights reserved. Permission is granted for internet users to make one paper copy for their own personal use. Further hardcopy reproduction is strictly prohibited. Permission to distribute the HTML document electronically on any medium other than the internet must be requested from the copyright holders by contacting the editors. Printed versions of the SML Basis Manual are available from Cambridge University Press. To order
- please visit www.cup.org (North America) or www.cup.cam.ac.uk (outside North America).