Re: [Tutor] Socket programming

2015-01-03 Thread Alan Gauld
On 03/01/15 11:48, pramod gowda wrote: client code: import socket client_socket=socket.socket() server_address='192.168.2.2' server_port= 80 see below regarding port numbers print("hello") client_socket.connect((server_address,server_port)) print("hello") data=client_socket.recv(1024) prin

[Tutor] Socket programming

2015-01-03 Thread pramod gowda
Hi, i am learning socket programming, client code: import socket client_socket=socket.socket() server_address='192.168.2.2' server_port= 80 print("hello") client_socket.connect((server_address,server_port)) print("hello") data=client_socket.recv(1024) print(data) client_socket.close() server

Re: [Tutor] Socket Programming

2013-04-08 Thread Lolo Lolo
on socket programming. if as a client or server, the information being sent has a buffer size on 2048, will this retrieve all data below 2KB? or can it be exceeded with say 2100? or does 2100 fall under 3KB?___ Tutor maillist - Tutor@python.org To uns

Re: [Tutor] Socket Programming

2013-04-08 Thread Alan Gauld
On 08/04/13 08:06, Mousumi Basu wrote: import socket import sys s=socket.socket(socket.AF_INET,socket.SOCK_DGRAM) try: s=s.bind(('172.18.2.11',2213)) print 'socket bind is complete' except socket.error,msg: print 'bind failed' sys.exit() Your first error is that when develo

Re: [Tutor] Socket Programming

2013-04-08 Thread Kushal Kumaran
Mousumi Basu writes: > I want to perform binding between two computers having ip addresses > 172.18.2.11 and 172.18.2.95.So i wrote the following code(on the computer > having IP address 172.18.2.95):- > > > import socket > import sys > s=socket.socket(socket.AF_INET,socket.SOCK_DGRAM) > try: >

Re: [Tutor] Socket Programming

2013-04-08 Thread Steven D'Aprano
On 08/04/13 17:06, Mousumi Basu wrote: I want to perform binding between two computers having ip addresses 172.18.2.11 and 172.18.2.95.So i wrote the following code(on the computer having IP address 172.18.2.95):- import socket import sys s=socket.socket(socket.AF_INET,socket.SOCK_DGRAM) try:

Re: [Tutor] Socket Programming

2013-04-08 Thread Timo
Op 08-04-13 09:06, Mousumi Basu schreef: I want to perform binding between two computers having ip addresses 172.18.2.11 and 172.18.2.95.So i wrote the following code(on the computer having IP address 172.18.2.95):- import socket import sys s=socket.socket(socket.AF_I

[Tutor] Socket Programming

2013-04-08 Thread Mousumi Basu
I want to perform binding between two computers having ip addresses 172.18.2.11 and 172.18.2.95.So i wrote the following code(on the computer having IP address 172.18.2.95):- import socket import sys s=socket.socket(socket.AF_INET,socket.SOCK_DGRAM) try: s=s.bind(('172.18.2.11',2213)) pr

Re: [Tutor] Socket Programming

2013-04-06 Thread Alan Gauld
On 05/04/13 11:47, Mousumi Basu wrote: s=socket.socket(socket.AF_INIT,socket.SCK_DGRM)) There is a double )) at the end of the line. That should give a different error so I assume this is not cut 'n paste code, but just in case I thought I'd point it out... s.bind(('172.18.2.11',8032)) Be

Re: [Tutor] Socket Programming

2013-04-05 Thread Chris Fuller
Have you checked out the socket HOWTO? http://docs.python.org/2/howto/sockets.html Cheers On Friday, April 05, 2013, Mousumi Basu wrote: > I want to perform bind function for socket programming between two > computers of ip addresses- 172.18.2.11 and 172.18.2.95 using the following > command(on

Re: [Tutor] Socket Programming

2013-04-05 Thread Steven D'Aprano
On 05/04/13 21:47, Mousumi Basu wrote: I want to perform bind function for socket programming between two computers of ip addresses- 172.18.2.11 and 172.18.2.95 using the following command(on the computer having IP address 172.18.2.95): s=socket.socket(socket.AF_INIT,socket.SCK_DGRM)) I get

[Tutor] Socket Programming

2013-04-05 Thread Mousumi Basu
I want to perform bind function for socket programming between two computers of ip addresses- 172.18.2.11 and 172.18.2.95 using the following command(on the computer having IP address 172.18.2.95): s=socket.socket(socket.AF_INIT,socket.SCK_DGRM)) s.bind(('172.18.2.11',8032)) But error is occurri

Re: [Tutor] Socket Programming

2012-01-29 Thread Navneet
On 1/27/2012 10:13 PM, Steven D'Aprano wrote: Navneet wrote: One more thing I want to add here is, I am trying to create the GUI based chat server.(Attached the programs.) Please do not send large chunks of code like this, unless asked. Instead, you should try to produce a minimal example t

Re: [Tutor] Socket Programming

2012-01-27 Thread Steven D'Aprano
Navneet wrote: One more thing I want to add here is, I am trying to create the GUI based chat server.(Attached the programs.) Please do not send large chunks of code like this, unless asked. Instead, you should try to produce a minimal example that demonstrates the problem. It should be:

Re: [Tutor] Socket Programming

2012-01-27 Thread Navneet
On 1/26/2012 4:22 PM, Navneet wrote: Hi, I am trying to create a chat program.(Programs are attached) Please find the code below, where I am having the problem. def run( self ): while 1: print "Hello There " print self.descriptors # Await an event on a readab

[Tutor] Socket Programming

2012-01-26 Thread Navneet
Hi, I am trying to create a chat program.(Programs are attached) Please find the code below, where I am having the problem. def run( self ): while 1: print "Hello There " print self.descriptors # Await an event on a readable socket descriptor (srea

Re: [Tutor] Socket Programming issue

2011-06-21 Thread Mark Tolonen
"aditya" wrote in message news:BANLkTikS+gzm=89thczpbwksd+wufec...@mail.gmail.com... This is a small client-server program in which i am using a Vbscript program to check for connectivity of 2 machines and write the output to a text file whether it connectes or not , for example the conten

Re: [Tutor] Socket Programming issue

2011-06-21 Thread aditya
On Tue, Jun 21, 2011 at 12:45 PM, Alan Gauld wrote: > > "aditya" wrote > > > is that although the Vbscript writes the output to the file correctly but >> when the client sends the contents of the file to the server via socket , >> it >> sometimes prints all the lines of the file on the server an

Re: [Tutor] Socket Programming issue

2011-06-21 Thread Alan Gauld
"aditya" wrote is that although the Vbscript writes the output to the file correctly but when the client sends the contents of the file to the server via socket , it sometimes prints all the lines of the file on the server and sometimes it doesnt , i dont know whether the issue is with the c

[Tutor] Socket Programming issue

2011-06-20 Thread aditya
This is a small client-server program in which i am using a Vbscript program to check for connectivity of 2 machines and write the output to a text file whether it connectes or not , for example the contents of the file *output.txt* are 192.168.1.2 is connected 192.168.1.10 is not connected No

Re: [Tutor] Socket Programming

2005-08-01 Thread Adam Bark
Hi Joe you can use 1 and just send 'Hi!' as long as something else isn't likely to be sent at the same time. It will just read what is in that socket when you call it so if something else that you don't want is there just behind what you're after then you could end up with that as well.On 8/1/0

Re: [Tutor] Socket Programming

2005-08-01 Thread Joseph Quigley
Hi, Ok. But what if I wanted to send a 1 mb message? Could I leave .recv(1) in and send 'Hi!' as well or would I have to change it? Thanks, JQ Adam Bark wrote: > You have to put in how many bytes of data you want to recieve in > clientsocket.recv() eg. clientsocket.recv(1024) for 1kB.

Re: [Tutor] Socket Programming

2005-08-01 Thread Joseph Quigley
Hi Johan, Johan Geldenhuys wrote: > I have more advanced examples if you want them, but start here and > look at the socket lib and you can start using select if you want to > wait for stuff from the server or client. > > Johan I'd love to see your examples. Could you send them directly to m

Re: [Tutor] Socket Programming

2005-08-01 Thread Adam Bark
You have to put in how many bytes of data you want to recieve in clientsocket.recv() eg. clientsocket.recv(1024) for 1kB.On 7/31/05, Joseph Quigley < [EMAIL PROTECTED]> wrote:Hi Dan, Danny Yoo wrote:>##>clientsocket.recv()>##>>should work better.>>Ok well I tried your examples but they didn

Re: [Tutor] Socket Programming

2005-08-01 Thread Joseph Quigley
Hi Dan, Danny Yoo wrote: >## >clientsocket.recv() >## > >should work better. > > Ok well I tried your examples but they didn't work. I still get: TypeError: recv() takes at least 1 argument (0 given) How can I fix this? ___ Tutor maillist -

Re: [Tutor] Socket Programming

2005-07-31 Thread Kent Johnson
Joseph Quigley wrote: > I have no idea how to get the server to receive and print a message or > for the client to send the message. Does anyone know of some good python > networking tutorials designed for newbies? (Not ones on > www.awaretek.com. They seem to expect you to know some things that

Re: [Tutor] Socket Programming

2005-07-30 Thread Danny Yoo
> I have no idea how to get the server to receive and print a message or > for the client to send the message. Does anyone know of some good python > networking tutorials designed for newbies? (Not ones on > www.awaretek.com. They seem to expect you to know some things that I > don't even know ab

[Tutor] Socket Programming

2005-07-30 Thread Joseph Quigley
I've got a little problem with my socket program(s): #Client import socket #create an INET, STREAMing socket s = socket.socket( socket.AF_INET, socket.SOCK_STREAM) s.connect(("localhost", 2000)) s.send('hello!'[totalsent:]) #Server import socket #create an INET, STREAMing socket serversocket