|
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 IP_ADD_MEMBERSHIP = 3 |
|
19 SOL_SOCKET = 4095 |
|
20 SO_REUSEADDR = 4 |
|
21 |
|
22 def socket(af=AF_INET, type=SOCK_STREAM, proto=IPPROTO_TCP): |
|
23 pass |
|
24 |
|
25 def getaddrinfo(host, port, af=0, type=0, proto=0, flags=0): |
|
26 pass |
|
27 |
|
28 def inet_ntop(af, bin_addr): |
|
29 pass |
|
30 |
|
31 def inet_pton(af, txt_addr): |
|
32 pass |
|
33 |
|
34 class Socket(): |
|
35 def close(self): |
|
36 pass |
|
37 |
|
38 def bind(self, address): |
|
39 pass |
|
40 |
|
41 def listen(self, backlog=None): |
|
42 pass |
|
43 |
|
44 def accept(self): |
|
45 pass |
|
46 |
|
47 def connect(self, address): |
|
48 pass |
|
49 |
|
50 def send(self, bytes): |
|
51 pass |
|
52 |
|
53 def sendall(self, bytes): |
|
54 pass |
|
55 |
|
56 def recv(self, bufsize): |
|
57 pass |
|
58 |
|
59 def sendto(self, bytes, address): |
|
60 pass |
|
61 |
|
62 def recvfrom(self, bufsize): |
|
63 pass |
|
64 |
|
65 def setsockopt(self, level, optname, value): |
|
66 pass |
|
67 |
|
68 def settimeout(self, value): |
|
69 pass |
|
70 |
|
71 def setblocking(self, flag): |
|
72 pass |
|
73 |
|
74 def makefile(self, mode='rb', buffering=0): |
|
75 pass |
|
76 |
|
77 def read(self, size=None): |
|
78 pass |
|
79 |
|
80 def readinto(self, buf, nbytes=None): |
|
81 pass |
|
82 |
|
83 def readline(self): |
|
84 pass |
|
85 |
|
86 def write(self, buf): |
|
87 pass |