<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Uncertain Binary Thoughts &#187; Chat</title>
	<atom:link href="http://ankurs.com/tag/chat/feed/" rel="self" type="application/rss+xml" />
	<link>http://ankurs.com</link>
	<description>01110100110101010101011101100010</description>
	<lastBuildDate>Mon, 30 Aug 2010 16:51:02 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>A simple python socket chat example</title>
		<link>http://ankurs.com/2009/07/a-simple-python-socket-chat-example/</link>
		<comments>http://ankurs.com/2009/07/a-simple-python-socket-chat-example/#comments</comments>
		<pubDate>Wed, 29 Jul 2009 19:08:34 +0000</pubDate>
		<dc:creator>Ankur Shrivastava</dc:creator>
				<category><![CDATA[Stuff]]></category>
		<category><![CDATA[Chat]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[socket]]></category>

		<guid isPermaLink="false">http://ankurs.com/?p=557</guid>
		<description><![CDATA[i was trying to explain sockets to one of my friend and this is what i used, the code should be self explanatory, this is a very simple application of sockets&#8230; download here]]></description>
			<content:encoded><![CDATA[<p>i was trying to explain sockets to one of my friend and this is what i used, the code should be self explanatory, this is a very simple application of sockets&#8230;</p>
<p><script src="http://gist.github.com/145536.js"></script></p>
<p>download <a href="http://gist.github.com/raw/145536/753a6d62042163710647574ea723c42807f44aef/python-socket-chat.py">here</a></p>
]]></content:encoded>
			<wfw:commentRss>http://ankurs.com/2009/07/a-simple-python-socket-chat-example/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Creating a Simple Chat Application with Python</title>
		<link>http://ankurs.com/2008/05/creating-a-simple-chat-application-with-python/</link>
		<comments>http://ankurs.com/2008/05/creating-a-simple-chat-application-with-python/#comments</comments>
		<pubDate>Thu, 01 May 2008 13:27:59 +0000</pubDate>
		<dc:creator>Ankur Shrivastava</dc:creator>
				<category><![CDATA[Life]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Special]]></category>
		<category><![CDATA[application]]></category>
		<category><![CDATA[Chat]]></category>
		<category><![CDATA[Creating]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[Simple]]></category>
		<category><![CDATA[sockets]]></category>

		<guid isPermaLink="false">http://ankurs.com/?p=370</guid>
		<description><![CDATA[Creating application with Python is very simple, here is a simple chat application made by using the socket module, it has 2 parts First Server and Second client, you run the server first and then connect the client to it, here is the code Here is the Server Code #!/usr/bin/env python from socket import *]]></description>
			<content:encoded><![CDATA[<p>Creating application with Python is very simple, here is a simple chat application made by using the socket module, it has 2 parts First Server and Second client, you run the server first and then connect the client to it, here is the code</p>
<p>Here is the Server Code<br />
<code><br />
#!/usr/bin/env python</p>
<p>from socket import *<br />
from time import time, ctime</p>
<p>IP = ''<br />
PORT = 23456<br />
ADS = (IP, PORT)</p>
<p>tcpsoc = socket(AF_INET, SOCK_STREAM)<br />
tcpsoc.bind(ADS)<br />
tcpsoc.listen(5)</p>
<p>while 1:<br />
	print "Waiting for connection"<br />
	tcpcli, addr = tcpsoc.accept()<br />
	print "connected from:", addr<br />
	while 1:<br />
		data = tcpcli.recv(1024)<br />
		if not data : break<br />
		print data<br />
		data1 = raw_input(">>")<br />
		if data1 == "q;t": break<br />
		tcpcli.send(data1)<br />
	tcpcli.close()<br />
tcpsoc.close()<br />
</code></p>
<p>Here is the client code<br />
<code><br />
#!/usr/bin/env python</p>
<p>from socket import *</p>
<p>IP = ''<br />
PORT = 23456<br />
ADS = (IP, PORT)</p>
<p>tcpsoc = socket(AF_INET, SOCK_STREAM)<br />
tcpsoc.connect(ADS)</p>
<p>while 1:<br />
	data = raw_input("msg>>")<br />
	if not data : break<br />
	tcpsoc.send(data)<br />
	data = tcpsoc.recv(1024)<br />
	if not data: break<br />
	print data<br />
tcpsoc.close()<br />
</code><br />
the code above might not be properly intended so you can download the code from <a href="http://fb.ankurs.com/tcp_server.py">http://fb.ankurs.com/tcp_server.py</a> and <a href="http://fb.ankurs.com/tcp_client.py">http://fb.ankurs.com/tcp_client.py</a><br />
enjoy!!!</p>
]]></content:encoded>
			<wfw:commentRss>http://ankurs.com/2008/05/creating-a-simple-chat-application-with-python/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>
