473,396 Members | 2,030 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

need help with recieving sockets

Hi I was wondering if any one could help me with a chat client I am
writing my main issue is not in the sending of messages or in the
connection setting.

I am having issues receiving the messages. I am using Tkinter as the GUI
and Python 2.3.5

my code has been edited so many times but no matter what I do everytime
I click my recieve button the client crashes and Tkinter freezes up and
I don't recieve the message back from the server.

Does anyone have any ideas what I am doing wrong

here is the latest function I am using:
def recv_basic():
textbox.insert(END, sock.recv(1024))
textbox.insert(END, "\n\n")

on a side note I can get the first connection message back from the
server if I click the recieve button. Another side note I have tried two
different servers one I wrote and another one I found in a tutorial

Cheers and thanks for any help
Dec 19 '05 #1
1 949
Andrew wrote:
Hi I was wondering if any one could help me with a chat client I am
writing my main issue is not in the sending of messages or in the
connection setting.


Your main issues should probably include those things and more. Judging
by the simplistic way you are attempting to get this to work, you
probably haven't read the following tutorial (see link below).

I strongly recommend you read that, and then _don't_ reinvent the wheel
but instead learn to use an existing package that hides many of these
mundane and difficult-to-get-right details from you.

The "asyncore" package in the standard library or Twisted are two
approaches, or you could learn about SocketServer and others also in the
standard library and use them instead.

http://www.amk.ca/python/howto/sockets/
-Peter

Dec 19 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: mrpolitics | last post by:
So I'm working with PureIRCD (http://sourceforge.net/projects/pure-ircd) and everything was fine untill yesterday when the server crashed. So I did a cold restart and staretd the server back up...
4
by: 0to60 | last post by:
I have a question about socket programming in general. Exactly what happens behind the scenes when I one socket connects to a different socket in listen mode? Using the dotnet framework, I...
3
by: Logan McKinley | last post by:
I have a C# program that uses blocking sockets and want to allow the user to stop the server. The problem I am having is the socket blocks on...
4
by: Emilio | last post by:
In the help pages for the UdpClient there is some sample code which sends a udp message and prints what it received. Can someone help me to finish the code present there? I think basically the...
3
by: Winston Nimchan | last post by:
Hi: I would like to build a socket server application that is user configurable using XML (app.config) and would like some guidance. I already have a single socket server working but would...
4
by: BadOmen | last post by:
Hi, What is the different between 'System.Net.Sockets.Socket' and 'System.Net.Sockets.TcpClient'? When do I use System.Net.Sockets.TcpClient and System.Net.Sockets.Socket?? Yours, Jonas
2
by: Stressed Out Developer | last post by:
We have an application that has a 200 count loop that does the following: ' Each time thru the loop we pass the next IP Address is a range (aka 192.168.4.50 thru 192.168.4.254) Try If...
12
by: manochavishal | last post by:
Hi, I am having strange problem in my Program. I cannot paste the whole program as it is huge so just pasting the lines i think are necessary. I am passing a integer array pointer to a...
7
by: rivers1 | last post by:
I'm not a tech by any stretch of the imagination but I'm hoping you guys can help. I'm recieving the object expected error on a host of sites but one in particular is bugging me, I know the site...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.