<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://onnocenter.or.id/wiki/index.php?action=history&amp;feed=atom&amp;title=Python3%3A_Echo_TCP</id>
	<title>Python3: Echo TCP - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://onnocenter.or.id/wiki/index.php?action=history&amp;feed=atom&amp;title=Python3%3A_Echo_TCP"/>
	<link rel="alternate" type="text/html" href="https://onnocenter.or.id/wiki/index.php?title=Python3:_Echo_TCP&amp;action=history"/>
	<updated>2026-04-16T04:14:59Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.35.4</generator>
	<entry>
		<id>https://onnocenter.or.id/wiki/index.php?title=Python3:_Echo_TCP&amp;diff=62668&amp;oldid=prev</id>
		<title>Onnowpurbo: Created page with &quot;==Client==   #!/usr/bin/env python     import socket     TCP_IP = '192.168.0.162'  TCP_PORT = 5005  BUFFER_SIZE = 1024  MESSAGE = b&quot;Apa Kabar?&quot;     s = socket.socket(socket.AF...&quot;</title>
		<link rel="alternate" type="text/html" href="https://onnocenter.or.id/wiki/index.php?title=Python3:_Echo_TCP&amp;diff=62668&amp;oldid=prev"/>
		<updated>2020-12-25T22:43:18Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;==Client==   #!/usr/bin/env python     import socket     TCP_IP = &amp;#039;192.168.0.162&amp;#039;  TCP_PORT = 5005  BUFFER_SIZE = 1024  MESSAGE = b&amp;quot;Apa Kabar?&amp;quot;     s = socket.socket(socket.AF...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;==Client==&lt;br /&gt;
&lt;br /&gt;
 #!/usr/bin/env python&lt;br /&gt;
  &lt;br /&gt;
 import socket &lt;br /&gt;
 &lt;br /&gt;
 TCP_IP = '192.168.0.162'&lt;br /&gt;
 TCP_PORT = 5005&lt;br /&gt;
 BUFFER_SIZE = 1024&lt;br /&gt;
 MESSAGE = b&amp;quot;Apa Kabar?&amp;quot;&lt;br /&gt;
  &lt;br /&gt;
 s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)&lt;br /&gt;
 s.connect((TCP_IP, TCP_PORT))&lt;br /&gt;
 s.send(MESSAGE)&lt;br /&gt;
 data = s.recv(BUFFER_SIZE)&lt;br /&gt;
 s.close()&lt;br /&gt;
 &lt;br /&gt;
 print( &amp;quot;received data:&amp;quot;, data )&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Server==&lt;br /&gt;
&lt;br /&gt;
 #!/usr/bin/env python&lt;br /&gt;
  &lt;br /&gt;
 import socket&lt;br /&gt;
  &lt;br /&gt;
 TCP_IP = '127.0.0.1'&lt;br /&gt;
 TCP_PORT = 5005&lt;br /&gt;
 BUFFER_SIZE = 20  # Normally 1024, but we want fast response&lt;br /&gt;
 &lt;br /&gt;
 s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)&lt;br /&gt;
 s.bind((TCP_IP, TCP_PORT))&lt;br /&gt;
 s.listen(1)&lt;br /&gt;
  &lt;br /&gt;
 conn, addr = s.accept()&lt;br /&gt;
 print( 'Connection address:', addr )&lt;br /&gt;
 while 1:&lt;br /&gt;
     data = conn.recv(BUFFER_SIZE)&lt;br /&gt;
     if not data: break&lt;br /&gt;
     print( &amp;quot;received data:&amp;quot;, data )&lt;br /&gt;
     conn.send(data)  # echo&lt;br /&gt;
 conn.close()&lt;/div&gt;</summary>
		<author><name>Onnowpurbo</name></author>
	</entry>
</feed>