<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
	
	>
<channel>
	<title>
	Comments on: How to Code a simple Socket Server in Python	</title>
	<atom:link href="https://www.binarytides.com/python-socket-server-code-example/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.binarytides.com/python-socket-server-code-example/</link>
	<description>News, Technology, Entertainment and more</description>
	<lastBuildDate>Fri, 13 Jan 2023 07:08:04 +0000</lastBuildDate>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.8.2</generator>
	<item>
		<title>
		By: N.sh		</title>
		<link>https://www.binarytides.com/python-socket-server-code-example/comment-page-1/#comment-238866</link>

		<dc:creator><![CDATA[N.sh]]></dc:creator>
		<pubDate>Sun, 22 Mar 2020 08:59:32 +0000</pubDate>
		<guid isPermaLink="false">http://www.binarytides.com/?p=5578#comment-238866</guid>

					<description><![CDATA[Hi i need your help ,anyone  
im dealing with project who needs to work via wifi in the next config&#039;
server(rpi3) vs 5 clinents(rpi zero w) 
each of the rpz is obstacle that connects to some sensors like accelmetor and ultrasoinc..and needs to retrive info to the server when he is being trigerred ,i saw that the most of impl&#039; are based on parallel and i want to see i there is a recomendation for using seq&#039; implementation ? 
i really like for some help 
thnx a lot]]></description>
			<content:encoded><![CDATA[<p>Hi i need your help ,anyone<br />
im dealing with project who needs to work via wifi in the next config&#8217;<br />
server(rpi3) vs 5 clinents(rpi zero w)<br />
each of the rpz is obstacle that connects to some sensors like accelmetor and ultrasoinc..and needs to retrive info to the server when he is being trigerred ,i saw that the most of impl&#8217; are based on parallel and i want to see i there is a recomendation for using seq&#8217; implementation ?<br />
i really like for some help<br />
thnx a lot</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: rameshwar singh		</title>
		<link>https://www.binarytides.com/python-socket-server-code-example/comment-page-1/#comment-169508</link>

		<dc:creator><![CDATA[rameshwar singh]]></dc:creator>
		<pubDate>Tue, 30 Oct 2018 07:19:29 +0000</pubDate>
		<guid isPermaLink="false">http://www.binarytides.com/?p=5578#comment-169508</guid>

					<description><![CDATA[.thank you for sharing useful post.
python programming tutorial
https://www.welookups.com]]></description>
			<content:encoded><![CDATA[<p>.thank you for sharing useful post.<br />
python programming tutorial<br />
<a href="https://www.welookups.com" rel="nofollow ugc">https://www.welookups.com</a></p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Zachay		</title>
		<link>https://www.binarytides.com/python-socket-server-code-example/comment-page-1/#comment-158204</link>

		<dc:creator><![CDATA[Zachay]]></dc:creator>
		<pubDate>Wed, 16 May 2018 23:58:27 +0000</pubDate>
		<guid isPermaLink="false">http://www.binarytides.com/?p=5578#comment-158204</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://www.binarytides.com/python-socket-server-code-example/comment-page-1/#comment-99466&quot;&gt;Jessica Levy&lt;/a&gt;.

Do you have python?? If not Go to: https://python.org/getit]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://www.binarytides.com/python-socket-server-code-example/comment-page-1/#comment-99466">Jessica Levy</a>.</p>
<p>Do you have python?? If not Go to: <a href="https://python.org/getit" rel="nofollow ugc">https://python.org/getit</a></p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Sarthak		</title>
		<link>https://www.binarytides.com/python-socket-server-code-example/comment-page-1/#comment-142664</link>

		<dc:creator><![CDATA[Sarthak]]></dc:creator>
		<pubDate>Wed, 22 Nov 2017 07:23:09 +0000</pubDate>
		<guid isPermaLink="false">http://www.binarytides.com/?p=5578#comment-142664</guid>

					<description><![CDATA[If we want to send the address in a different way, is it possible? Something like &quot;{address}:{port}/test.mjpg&quot;. I wish to add the &#039;/test.mjpg&#039; along the IP address and PORT number. Any suggestions?]]></description>
			<content:encoded><![CDATA[<p>If we want to send the address in a different way, is it possible? Something like &#8220;{address}:{port}/test.mjpg&#8221;. I wish to add the &#8216;/test.mjpg&#8217; along the IP address and PORT number. Any suggestions?</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: shenbagaraman		</title>
		<link>https://www.binarytides.com/python-socket-server-code-example/comment-page-1/#comment-141682</link>

		<dc:creator><![CDATA[shenbagaraman]]></dc:creator>
		<pubDate>Fri, 17 Nov 2017 12:12:23 +0000</pubDate>
		<guid isPermaLink="false">http://www.binarytides.com/?p=5578#comment-141682</guid>

					<description><![CDATA[import socket
import time
import select

sock = socket.socket(socket.AF_INET,socket.SOCK_STREAM)
sock.bind((&#039;192.168.161.31&#039;,20001))
sock.listen(1)
sock.setsockopt(socket.SOL_SOCKET,socket.SO_REUSEADDR,1)
clientsocket,addr = sock.accept()
def square(X):
        return X*X
def add(a,b):
        return a+b
#task = &#039;sqrt of 16 is,.math.sqrt&#039;
try:
        while true:
                #square = 10
                #for i in range(1,100):
                        #square = square + 10
             clientsocket.sendall(square(X))
             time.sleep(10)

the above code is correct? and i need to pass function server to client]]></description>
			<content:encoded><![CDATA[<p>import socket<br />
import time<br />
import select</p>
<p>sock = socket.socket(socket.AF_INET,socket.SOCK_STREAM)<br />
sock.bind((&#8216;192.168.161.31&#8217;,20001))<br />
sock.listen(1)<br />
sock.setsockopt(socket.SOL_SOCKET,socket.SO_REUSEADDR,1)<br />
clientsocket,addr = sock.accept()<br />
def square(X):<br />
        return X*X<br />
def add(a,b):<br />
        return a+b<br />
#task = &#8216;sqrt of 16 is,.math.sqrt&#8217;<br />
try:<br />
        while true:<br />
                #square = 10<br />
                #for i in range(1,100):<br />
                        #square = square + 10<br />
             clientsocket.sendall(square(X))<br />
             time.sleep(10)</p>
<p>the above code is correct? and i need to pass function server to client</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: graket		</title>
		<link>https://www.binarytides.com/python-socket-server-code-example/comment-page-1/#comment-125996</link>

		<dc:creator><![CDATA[graket]]></dc:creator>
		<pubDate>Fri, 04 Aug 2017 16:47:39 +0000</pubDate>
		<guid isPermaLink="false">http://www.binarytides.com/?p=5578#comment-125996</guid>

					<description><![CDATA[So every time I press a key, it will say
&quot;ok.....
*I press h*
OkH... OkI....
and it doesnt even show up on the server either]]></description>
			<content:encoded><![CDATA[<p>So every time I press a key, it will say<br />
&#8220;ok&#8230;..<br />
*I press h*<br />
OkH&#8230; OkI&#8230;.<br />
and it doesnt even show up on the server either</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: aysadk		</title>
		<link>https://www.binarytides.com/python-socket-server-code-example/comment-page-1/#comment-124602</link>

		<dc:creator><![CDATA[aysadk]]></dc:creator>
		<pubDate>Sat, 22 Jul 2017 13:16:02 +0000</pubDate>
		<guid isPermaLink="false">http://www.binarytides.com/?p=5578#comment-124602</guid>

					<description><![CDATA[you have to update your code with right syntax for print command
print (&quot;my test is cool now&quot;)]]></description>
			<content:encoded><![CDATA[<p>you have to update your code with right syntax for print command<br />
print (&#8220;my test is cool now&#8221;)</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Manish		</title>
		<link>https://www.binarytides.com/python-socket-server-code-example/comment-page-1/#comment-121327</link>

		<dc:creator><![CDATA[Manish]]></dc:creator>
		<pubDate>Sat, 17 Jun 2017 19:52:20 +0000</pubDate>
		<guid isPermaLink="false">http://www.binarytides.com/?p=5578#comment-121327</guid>

					<description><![CDATA[If i want to keep my socket open forever weather there is client connection or not what should i Do? i want to do my listener socket keep up and listen on port 35520 and insert received values in mysql database. what should i do?]]></description>
			<content:encoded><![CDATA[<p>If i want to keep my socket open forever weather there is client connection or not what should i Do? i want to do my listener socket keep up and listen on port 35520 and insert received values in mysql database. what should i do?</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Jessica Levy		</title>
		<link>https://www.binarytides.com/python-socket-server-code-example/comment-page-1/#comment-99466</link>

		<dc:creator><![CDATA[Jessica Levy]]></dc:creator>
		<pubDate>Thu, 01 Dec 2016 07:59:09 +0000</pubDate>
		<guid isPermaLink="false">http://www.binarytides.com/?p=5578#comment-99466</guid>

					<description><![CDATA[hi

maybe can help me out...
mine literally doesn&#039;t run
why could that be?]]></description>
			<content:encoded><![CDATA[<p>hi</p>
<p>maybe can help me out&#8230;<br />
mine literally doesn&#8217;t run<br />
why could that be?</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Yogeesh Seralathan		</title>
		<link>https://www.binarytides.com/python-socket-server-code-example/comment-page-1/#comment-75761</link>

		<dc:creator><![CDATA[Yogeesh Seralathan]]></dc:creator>
		<pubDate>Sun, 01 May 2016 06:50:10 +0000</pubDate>
		<guid isPermaLink="false">http://www.binarytides.com/?p=5578#comment-75761</guid>

					<description><![CDATA[Polling is a nice little hack of handling multiple clients. But is it faster than multithreading.? I assume polling will use fewer resources than multithreading.]]></description>
			<content:encoded><![CDATA[<p>Polling is a nice little hack of handling multiple clients. But is it faster than multithreading.? I assume polling will use fewer resources than multithreading.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Sagar kumar		</title>
		<link>https://www.binarytides.com/python-socket-server-code-example/comment-page-1/#comment-70540</link>

		<dc:creator><![CDATA[Sagar kumar]]></dc:creator>
		<pubDate>Tue, 15 Mar 2016 16:39:05 +0000</pubDate>
		<guid isPermaLink="false">http://www.binarytides.com/?p=5578#comment-70540</guid>

					<description><![CDATA[Thanks for tutorial. I haven&#039;t tried it yet but I want to ask one thing. Will it work for images like On android app, I want to send image to python script at backend server and server process it and rply me back to the app.???]]></description>
			<content:encoded><![CDATA[<p>Thanks for tutorial. I haven&#8217;t tried it yet but I want to ask one thing. Will it work for images like On android app, I want to send image to python script at backend server and server process it and rply me back to the app.???</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: ted		</title>
		<link>https://www.binarytides.com/python-socket-server-code-example/comment-page-1/#comment-68370</link>

		<dc:creator><![CDATA[ted]]></dc:creator>
		<pubDate>Fri, 19 Feb 2016 08:50:12 +0000</pubDate>
		<guid isPermaLink="false">http://www.binarytides.com/?p=5578#comment-68370</guid>

					<description><![CDATA[Great tutorial, very helpful, thank you very much. One question, if the pipe was broken due to network connection, how could a client reconnect to the server? Thanks in advance.]]></description>
			<content:encoded><![CDATA[<p>Great tutorial, very helpful, thank you very much. One question, if the pipe was broken due to network connection, how could a client reconnect to the server? Thanks in advance.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: hypixus		</title>
		<link>https://www.binarytides.com/python-socket-server-code-example/comment-page-1/#comment-68006</link>

		<dc:creator><![CDATA[hypixus]]></dc:creator>
		<pubDate>Wed, 29 Jul 2015 11:52:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.binarytides.com/?p=5578#comment-68006</guid>

					<description><![CDATA[PERFECT tutorial for me. Only things i needed were transforming it to python 3.X and adding Polish letters support, but that was easy with this.


def strToBytes(strToConvert):

    return str.encode(strToConvert, &#039;UTF-8&#039;)
def bytesToStr(dataToConvert):
    return str(dataToConvert, &#039;UTF-8&#039;)


In every place bugs of TypeError were replaced with these functions - everything was fine.]]></description>
			<content:encoded><![CDATA[<p>PERFECT tutorial for me. Only things i needed were transforming it to python 3.X and adding Polish letters support, but that was easy with this.</p>
<p>def strToBytes(strToConvert):</p>
<p>    return str.encode(strToConvert, &#8216;UTF-8&#8217;)<br />
def bytesToStr(dataToConvert):<br />
    return str(dataToConvert, &#8216;UTF-8&#8217;)</p>
<p>In every place bugs of TypeError were replaced with these functions &#8211; everything was fine.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: s dubbya		</title>
		<link>https://www.binarytides.com/python-socket-server-code-example/comment-page-1/#comment-67704</link>

		<dc:creator><![CDATA[s dubbya]]></dc:creator>
		<pubDate>Sat, 27 Dec 2014 01:22:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.binarytides.com/?p=5578#comment-67704</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://www.binarytides.com/python-socket-server-code-example/comment-page-1/#comment-65681&quot;&gt;anu nivas&lt;/a&gt;.

select.select]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://www.binarytides.com/python-socket-server-code-example/comment-page-1/#comment-65681">anu nivas</a>.</p>
<p>select.select</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Steve N		</title>
		<link>https://www.binarytides.com/python-socket-server-code-example/comment-page-1/#comment-67626</link>

		<dc:creator><![CDATA[Steve N]]></dc:creator>
		<pubDate>Thu, 27 Nov 2014 12:54:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.binarytides.com/?p=5578#comment-67626</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://www.binarytides.com/python-socket-server-code-example/comment-page-1/#comment-65716&quot;&gt;test&lt;/a&gt;.

it can be written as :

def broadcast(connected):
    
    while connected:
            data = connected.recv(BUFFER_SIZE)
            
            if data:
                data = str(connected.getpeername()) + &#039;says  --&#062;&#039; + data
                for c in client_list:
                    if c is not connected:
                        c.sendall(data)
            else:
                client_index = client_list.index(connected)
                print &#039;Client&#039; + str(connected.getpeername()) + &#039; has left the chat.&#039;
                client_list.pop(client_index)
                print &#039;The are &#039; + str(len(client_list)) + &#039; remaining clients&#039; 

                break]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://www.binarytides.com/python-socket-server-code-example/comment-page-1/#comment-65716">test</a>.</p>
<p>it can be written as :</p>
<p>def broadcast(connected):</p>
<p>    while connected:<br />
            data = connected.recv(BUFFER_SIZE)</p>
<p>            if data:<br />
                data = str(connected.getpeername()) + &#8216;says  &#8211;&gt;&#8217; + data<br />
                for c in client_list:<br />
                    if c is not connected:<br />
                        c.sendall(data)<br />
            else:<br />
                client_index = client_list.index(connected)<br />
                print &#8216;Client&#8217; + str(connected.getpeername()) + &#8216; has left the chat.&#8217;<br />
                client_list.pop(client_index)<br />
                print &#8216;The are &#8216; + str(len(client_list)) + &#8216; remaining clients&#8217; </p>
<p>                break</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: sly		</title>
		<link>https://www.binarytides.com/python-socket-server-code-example/comment-page-1/#comment-67592</link>

		<dc:creator><![CDATA[sly]]></dc:creator>
		<pubDate>Mon, 17 Nov 2014 01:16:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.binarytides.com/?p=5578#comment-67592</guid>

					<description><![CDATA[This is my second post of the day which should also serve as the answer to my previous question.  I found the event handling APIs, asyncore.loop and asyncore.dispatcher.  Thank you though]]></description>
			<content:encoded><![CDATA[<p>This is my second post of the day which should also serve as the answer to my previous question.  I found the event handling APIs, asyncore.loop and asyncore.dispatcher.  Thank you though</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: sly		</title>
		<link>https://www.binarytides.com/python-socket-server-code-example/comment-page-1/#comment-67590</link>

		<dc:creator><![CDATA[sly]]></dc:creator>
		<pubDate>Mon, 17 Nov 2014 00:25:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.binarytides.com/?p=5578#comment-67590</guid>

					<description><![CDATA[Your programs often used the &quot;while true,,&quot; loop to listen to client request(s).  Isn&#039;t there an event driven check like ~ Server Socket.Listen is ready before Socket.Accept.  I think loop is resource intensive.  Please advise !]]></description>
			<content:encoded><![CDATA[<p>Your programs often used the &#8220;while true,,&#8221; loop to listen to client request(s).  Isn&#8217;t there an event driven check like ~ Server Socket.Listen is ready before Socket.Accept.  I think loop is resource intensive.  Please advise !</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: sly		</title>
		<link>https://www.binarytides.com/python-socket-server-code-example/comment-page-1/#comment-67591</link>

		<dc:creator><![CDATA[sly]]></dc:creator>
		<pubDate>Mon, 17 Nov 2014 00:25:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.binarytides.com/?p=5578#comment-67591</guid>

					<description><![CDATA[Your programs often used the &quot;while true,,&quot; loop to listen to client request(s).  Isn&#039;t there an event driven check like ~ Server Socket.Listen is ready before Socket.Accept.  I think loop is resource intensive.  Please advise !]]></description>
			<content:encoded><![CDATA[<p>Your programs often used the &#8220;while true,,&#8221; loop to listen to client request(s).  Isn&#8217;t there an event driven check like ~ Server Socket.Listen is ready before Socket.Accept.  I think loop is resource intensive.  Please advise !</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Balaji		</title>
		<link>https://www.binarytides.com/python-socket-server-code-example/comment-page-1/#comment-67514</link>

		<dc:creator><![CDATA[Balaji]]></dc:creator>
		<pubDate>Thu, 16 Oct 2014 13:04:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.binarytides.com/?p=5578#comment-67514</guid>

					<description><![CDATA[Hi, I need a help on python programming by creating Server connectivity. Any one kindly suggest me on the following is feasible . Server1 and Server2 will have the single socket connection and the connection should always active. Now the Server1 listen to Client 1 and get the messages and forward to Server 2 by using the available connection and get the response and send it back to the client.]]></description>
			<content:encoded><![CDATA[<p>Hi, I need a help on python programming by creating Server connectivity. Any one kindly suggest me on the following is feasible . Server1 and Server2 will have the single socket connection and the connection should always active. Now the Server1 listen to Client 1 and get the messages and forward to Server 2 by using the available connection and get the response and send it back to the client.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: BabyCakes		</title>
		<link>https://www.binarytides.com/python-socket-server-code-example/comment-page-1/#comment-67511</link>

		<dc:creator><![CDATA[BabyCakes]]></dc:creator>
		<pubDate>Thu, 16 Oct 2014 01:22:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.binarytides.com/?p=5578#comment-67511</guid>

					<description><![CDATA[Hi Silver Moon, thanks for the tutorials. What&#039;s going on with the broadcast_data function? There is no such function provided in your code.]]></description>
			<content:encoded><![CDATA[<p>Hi Silver Moon, thanks for the tutorials. What&#8217;s going on with the broadcast_data function? There is no such function provided in your code.</p>
]]></content:encoded>
		
			</item>
	</channel>
</rss>
