author | Claus Gittinger <cg@exept.de> |
Wed, 21 May 2003 19:03:42 +0200 | |
changeset 1226 | 0114bd044aa9 |
parent 1164 | 41a2750af1fa |
child 1228 | b766b9873ba6 |
permissions | -rw-r--r-- |
100 | 1 |
" |
2 |
COPYRIGHT (c) 1995 by Claus Gittinger |
|
3 |
All Rights Reserved |
|
4 |
||
5 |
This software is furnished under a license and may be used |
|
6 |
only in accordance with the terms of that license and with the |
|
7 |
inclusion of the above copyright notice. This software may not |
|
8 |
be provided or otherwise made available to, or used by, any |
|
9 |
other person. No title to or ownership of the software is |
|
10 |
hereby transferred. |
|
11 |
" |
|
12 |
||
1164 | 13 |
"{ Package: 'stx:libbasic2' }" |
14 |
||
818 | 15 |
SocketAddress variableByteSubclass:#UDSocketAddress |
1164 | 16 |
instanceVariableNames:'' |
488 | 17 |
classVariableNames:'' |
18 |
poolDictionaries:'' |
|
816 | 19 |
category:'OS-Sockets' |
100 | 20 |
! |
21 |
||
22 |
!UDSocketAddress class methodsFor:'documentation'! |
|
23 |
||
24 |
copyright |
|
25 |
" |
|
26 |
COPYRIGHT (c) 1995 by Claus Gittinger |
|
27 |
All Rights Reserved |
|
28 |
||
29 |
This software is furnished under a license and may be used |
|
30 |
only in accordance with the terms of that license and with the |
|
31 |
inclusion of the above copyright notice. This software may not |
|
32 |
be provided or otherwise made available to, or used by, any |
|
33 |
other person. No title to or ownership of the software is |
|
34 |
hereby transferred. |
|
35 |
" |
|
36 |
! |
|
37 |
||
38 |
documentation |
|
39 |
" |
|
111 | 40 |
Instances of UDSocketAddress represent unix-domain socket names. |
41 |
||
100 | 42 |
ST-80 compatibility class. |
43 |
This may be required when existing code has to be ported to ST/X; |
|
44 |
however, it may not be complete and more protocol may be added in the future. |
|
45 |
The code here was created when public domain code (Manchester) had to |
|
46 |
be ported to ST/X and missing classes/methods were encountered, and code added |
|
47 |
by reasoning 'what the original class could probably do there'. |
|
48 |
||
49 |
This is an additional goody class; therefore: |
|
50 |
||
51 |
THIS SOFTWARE IS PROVIDED BY THE CONTRIBUTOR ``AS IS'' AND |
|
52 |
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
|
53 |
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
|
54 |
ARE DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTOR BE LIABLE |
|
55 |
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
|
56 |
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS |
|
57 |
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) |
|
58 |
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT |
|
59 |
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY |
|
60 |
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
|
61 |
SUCH DAMAGE. |
|
62 |
" |
|
63 |
! ! |
|
64 |
||
65 |
!UDSocketAddress class methodsFor:'instance creation'! |
|
66 |
||
67 |
name: pathName |
|
68 |
^ self new name:pathName |
|
69 |
||
70 |
" |
|
71 |
UDSocketAddress name:'/tmp/aUnixDomainSocket' |
|
72 |
" |
|
73 |
! ! |
|
74 |
||
1164 | 75 |
!UDSocketAddress class methodsFor:'queries'! |
76 |
||
77 |
domainSymbol |
|
100 | 78 |
|
1226
0114bd044aa9
vw compatible domainSymbols (afXXX)
Claus Gittinger <cg@exept.de>
parents:
1164
diff
changeset
|
79 |
^ #'AF_UNIX' |
0114bd044aa9
vw compatible domainSymbols (afXXX)
Claus Gittinger <cg@exept.de>
parents:
1164
diff
changeset
|
80 |
! |
0114bd044aa9
vw compatible domainSymbols (afXXX)
Claus Gittinger <cg@exept.de>
parents:
1164
diff
changeset
|
81 |
|
0114bd044aa9
vw compatible domainSymbols (afXXX)
Claus Gittinger <cg@exept.de>
parents:
1164
diff
changeset
|
82 |
obsoleteDomainSymbol |
1164 | 83 |
^ #unix |
84 |
! |
|
85 |
||
86 |
socketAddressSize |
|
87 |
^ OperatingSystem socketAccessor socketAddressSize:#unix |
|
1226
0114bd044aa9
vw compatible domainSymbols (afXXX)
Claus Gittinger <cg@exept.de>
parents:
1164
diff
changeset
|
88 |
! |
0114bd044aa9
vw compatible domainSymbols (afXXX)
Claus Gittinger <cg@exept.de>
parents:
1164
diff
changeset
|
89 |
|
0114bd044aa9
vw compatible domainSymbols (afXXX)
Claus Gittinger <cg@exept.de>
parents:
1164
diff
changeset
|
90 |
vwDomainSymbol |
0114bd044aa9
vw compatible domainSymbols (afXXX)
Claus Gittinger <cg@exept.de>
parents:
1164
diff
changeset
|
91 |
^ #afUnix |
100 | 92 |
! ! |
93 |
||
1164 | 94 |
!UDSocketAddress methodsFor:'accessing'! |
95 |
||
96 |
name |
|
97 |
||
98 |
^ self stringAt:3 |
|
99 |
! |
|
100 |
||
101 |
name:pathName |
|
102 |
||
103 |
self stringAt:3 put:pathName |
|
104 |
! ! |
|
105 |
||
106 |
!UDSocketAddress methodsFor:'obsolete'! |
|
100 | 107 |
|
488 | 108 |
address |
109 |
^ nil |
|
110 |
! |
|
111 |
||
111 | 112 |
hostName |
1164 | 113 |
^ 'local' |
114 |
! |
|
115 |
||
116 |
hostName:hostOrPathName port:portNrOrName |
|
117 |
||
118 |
self name:hostOrPathName |
|
119 |
! |
|
120 |
||
121 |
port:pathName |
|
122 |
||
123 |
self name:pathName |
|
111 | 124 |
! |
125 |
||
100 | 126 |
portOrName |
1164 | 127 |
|
128 |
^ self name |
|
129 |
! ! |
|
130 |
||
131 |
!UDSocketAddress methodsFor:'printing & storing'! |
|
132 |
||
133 |
printOn:aStream |
|
134 |
||
135 |
||
136 |
aStream nextPutAll:self class name; |
|
137 |
nextPut:$(; nextPutAll:self name; nextPut:$) |
|
138 |
||
139 |
" |
|
140 |
(self name:'/tmp/abcde') printString |
|
141 |
" |
|
100 | 142 |
! ! |
143 |
||
488 | 144 |
!UDSocketAddress class methodsFor:'documentation'! |
145 |
||
146 |
version |
|
1226
0114bd044aa9
vw compatible domainSymbols (afXXX)
Claus Gittinger <cg@exept.de>
parents:
1164
diff
changeset
|
147 |
^ '$Header: /cvs/stx/stx/libbasic2/UDSocketAddress.st,v 1.9 2003-05-21 17:03:09 cg Exp $' |
488 | 148 |
! ! |