Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

Python 

Socket Chat Bug

I have created this Simple CHAT System using Socket Module, But When the message is sent, It doesn't really appear unless ENTER is pressed.

Can anyone tell me what I'm missing or anything that could fix this Bug?

Here is the Code :
SERVER :
Spoiler (Click to View)

CLIENT :
Spoiler (Click to View)
Code
def autoRECV():
    while True:
            data = s.recv(1024).decode('ascii')
            print("Received : ", data)

perhaps you mean to break out of the loop, else the MSGSender function won't ever be reached.
Mon affection- pour toi, toujours
Your whole code is being held up by the input() function. After you press enter it skips the function only to get stuck at that same function again. If you want to do this I suggest making a new thread for your input command.
I'm all for using this as a learning tool, but the socket module should not be used in any legitimate applications other than constants or setsockopt or something like that. There's no reason to manually deal with sockets with so many amazing applications provide a safe, higher level API.
SRPP Discord Server

I am a professional network/cloud security architect.
My Old Tutorials


Possibly Related Threads...
Thread / Author Replies Views Last Post
[.NET] by FlzdudenFeb 3, 2016 04:32 AM 15 483 Feb 3, 2016 04:32 AM
Last Post: +Haze
[Python] by scriptzzzMay 27, 2015 09:46 AM 5 359 May 27, 2015 09:46 AM
Last Post: pyrotheseus
[C#] by katetemAug 24, 2014 07:19 PM 4 280 Aug 24, 2014 07:19 PM
Last Post: katetem