Home | History | Annotate | Download | only in sockets

Lines Matching refs:port

5 # Usage: gopher [ [selector] host [port] ]

12 # Default selector, host and port
40 # Open a TCP connection to a given host and port
41 def open_socket(host, port):
42 if not port:
43 port = DEF_PORT
44 elif type(port) == type(''):
45 port = string.atoi(port)
47 s.connect((host, port))
50 # Send a selector to a given host and port, return a file with the reply
51 def send_request(selector, host, port):
52 s = open_socket(host, port)
58 def get_menu(selector, host, port):
59 f = send_request(selector, host, port)
88 def get_textfile(selector, host, port):
90 get_alt_textfile(selector, host, port, list.append)
94 def get_alt_textfile(selector, host, port, func):
95 f = send_request(selector, host, port)
113 def get_binary(selector, host, port):
114 f = send_request(selector, host, port)
120 def get_alt_binary(selector, host, port, func, blocksize):
121 f = send_request(selector, host, port)
134 port = DEF_PORT
141 port = args[2]
145 browse_menu(selector, host, port)
153 def browse_menu(selector, host, port):
154 list = get_menu(selector, host, port)
158 print 'Host:', host, ' Port:', port
199 def browse_textfile(selector, host, port):
204 get_alt_textfile(selector, host, port, x.writeln)
214 get_alt_textfile(selector, host, port, x.writeln)
221 def browse_search(selector, host, port):
225 print 'Host:', host, ' Port:', port
238 browse_menu(selector + TAB + query, host, port)
241 def browse_telnet(selector, host, port):
244 if type(port) <> type(''):
245 port = repr(port)
246 sts = os.system('set -x; exec telnet ' + host + ' ' + port)
251 def browse_binary(selector, host, port):
256 get_alt_binary(selector, host, port, x.write, 8*1024)
260 def browse_sound(selector, host, port):
261 browse_binary(selector, host, port)
327 print 'usage: gopher [ [selector] host [port] ]'
333 port = string.atoi(sys.argv[2])
339 port = ''
340 browser(selector, host, port)