Sockets: Difference between revisions
Content added Content deleted
(→{{header|Python}}: Needs to be imported or referenced in its namespace) |
m (Fixed lang tags.) |
||
Line 4:
=={{header|Ada}}==
{{libheader|GNAT RTL}}
<lang ada>with GNAT.Sockets; use GNAT.Sockets;
procedure SocketSend is
Line 24 ⟶ 23:
Initialize;
sendData ("127.0.0.1","Hello Socket World");
end;</lang>
</lang>▼
=={{header|AutoHotkey}}==
modified from
Line 153 ⟶ 151:
ExitSub:
DllCall("Ws2_32\WSACleanup")
ExitApp</lang>
=={{header|C}}==
Line 229 ⟶ 226:
; No value</lang>
<lang lisp>aurora ~% sudo nc -l -p 256
hello socket world</lang>
Line 249 ⟶ 246:
=={{header|Forth}}==
{{works with|GNU Forth|0.7.0}}
<lang forth>include unix/socket.fs
s" localhost" 256 open-socket
Line 256 ⟶ 252:
dup s" hello socket world" rot write-socket
close-socket</lang>
=={{header|Haskell}}==
=={{header|Icon}}==
=={{header|IDL}}==
<tt>
<lang
</tt>
Line 350 ⟶ 345:
=={{header|Rhope}}==
{{works with|Rhope|alpha 1}}
▲:|</lang>
The connection is automatically closed when the object is freed.
Line 363 ⟶ 358:
=={{header|Seed7}}==
Line 380 ⟶ 375:
This uses fairly verbose and low level messages. This will probably be simplified in the future.
<lang slate>[ | socket |
[ | addr stream |
addr: (Net SocketAddress newOn: '127.0.0.1:256').
Line 390 ⟶ 383:
stream nextPutAll: ('hello socket world' as: ByteArray)
] ensure: [socket close]
] do.</lang>
=={{header|Smalltalk}}==
Line 453 ⟶ 445:
=={{header|Toka}}==
<lang
=={{header|UnixPipes}}==
=={{header|UNIX Shell}}==
Line 475 ⟶ 467:
Using the program <tt>netcat</tt> (<tt>nc</tt>)
<lang bash>echo "hello socket world" | netcat localhost 256</lang>▼
▲echo "hello socket world" | netcat localhost 256
{{omit from|TI-83 BASIC}} {{omit from|TI-89 BASIC}} <!-- Does not have network access. -->
|