|
1 # -*- coding: utf-8 -*- |
|
2 |
|
3 # Copyright (c) 2019 Detlev Offenbach <detlev@die-offenbachs.de> |
|
4 # |
|
5 |
|
6 """ |
|
7 Module containing stubs for API generation of the def 'usocket' module. |
|
8 """ |
|
9 |
|
10 AF_INET = 2 |
|
11 AF_INET6 = 10 |
|
12 SOCK_STREAM = 1 |
|
13 SOCK_DGRAM = 2 |
|
14 SOCK_RAW = 3 |
|
15 IPPROTO_IP = 0 |
|
16 IPPROTO_UDP = 17 |
|
17 IPPROTO_TCP = 6 |
|
18 IPPROTO_SEC = 0 |
|
19 IP_ADD_MEMBERSHIP = 3 |
|
20 SOL_SOCKET = 4095 |
|
21 SO_REUSEADDR = 4 |
|
22 |
|
23 error = Exception() |
|
24 |
|
25 def socket(af=AF_INET, type=SOCK_STREAM, proto=IPPROTO_TCP): |
|
26 pass |
|
27 |
|
28 def getaddrinfo(host, port, af=0, type=0, proto=0, flags=0): |
|
29 pass |
|
30 |
|
31 def inet_ntop(af, bin_addr): |
|
32 pass |
|
33 |
|
34 def inet_pton(af, txt_addr): |
|
35 pass |
|
36 |
|
37 class Socket(): |
|
38 def close(self): |
|
39 pass |
|
40 |
|
41 def bind(self, address): |
|
42 pass |
|
43 |
|
44 def listen(self, backlog=None): |
|
45 pass |
|
46 |
|
47 def accept(self): |
|
48 pass |
|
49 |
|
50 def connect(self, address): |
|
51 pass |
|
52 |
|
53 def send(self, bytes): |
|
54 pass |
|
55 |
|
56 def sendall(self, bytes): |
|
57 pass |
|
58 |
|
59 def recv(self, bufsize): |
|
60 pass |
|
61 |
|
62 def sendto(self, bytes, address): |
|
63 pass |
|
64 |
|
65 def recvfrom(self, bufsize): |
|
66 pass |
|
67 |
|
68 def setsockopt(self, level, optname, value): |
|
69 pass |
|
70 |
|
71 def settimeout(self, value): |
|
72 pass |
|
73 |
|
74 def setblocking(self, flag): |
|
75 pass |
|
76 |
|
77 def makefile(self, mode='rb', buffering=0): |
|
78 pass |
|
79 |
|
80 def read(self, size=None): |
|
81 pass |
|
82 |
|
83 def readinto(self, buf, nbytes=None): |
|
84 pass |
|
85 |
|
86 def readline(self): |
|
87 pass |
|
88 |
|
89 def write(self, buf): |
|
90 pass |