Attachment 'unix_socket_klient.py'
Download 1 import socket
2 import os
3 import sys
4
5 if len(sys.argv)<=1:
6 print "Daj mi nejake cele cislo ako parameter"
7 sys.exit(1)
8
9 serveraddress="/tmp/square_server"
10 sock=socket.socket(socket.AF_UNIX,socket.SOCK_STREAM)
11 sock.connect(serveraddress)
12
13 print "klient: posielam servrovi", sys.argv[1]
14 sock.send(sys.argv[1])
15
16 ret=sock.recv(1024)
17 print "klient: server povedal, ze", ret
18
19 sock.close()
Attached Files
To refer to attachments on a page, use attachment:filename, as shown below in the list of files. Do NOT use the URL of the [get] link, since this is subject to change and can break easily.- [get | view] (2008-04-25 09:01:28, 0.4 KB) [[attachment:unix_socket_klient.py]]
- [get | view] (2008-04-25 09:01:28, 0.8 KB) [[attachment:unix_socket_server.py]]
You are not allowed to attach a file to this page.