Python send file through socket




















It doesn't crash, the script is just finished. Note that s. You are closing the server socket s in your code after handling the first client connection. Thus only one client is ever handled by your server. Make a loop around accept and reading from the sc. Stack Overflow for Teams — Collaborate and share knowledge with a private group. Create a free Team What is Teams?

Collectives on Stack Overflow. Learn more. Send a file through sockets in Python Ask Question. Asked 9 years, 10 months ago. Active 11 months ago. Bind and listen. Accept connections. Send some data back to the client. Accepted a connection request from Toggle navigation Pythontic. Client sends Hello server! The problem is extra 13 byte which server.

This resolves the issue, tried with different format and sizes of files. If anyone knows what this starting 13 bytes refers to, please reply. Stack Overflow for Teams — Collaborate and share knowledge with a private group.

Create a free Team What is Teams? Collectives on Stack Overflow. Learn more. Asked 7 years, 1 month ago. Active 1 year, 10 months ago. Viewed k times. Improve this question. Swaathi Kakarla. Swaathi Kakarla Swaathi Kakarla 1, 1 1 gold badge 15 15 silver badges 26 26 bronze badges.

Add a comment. Active Oldest Votes. Improve this answer. All the best with your work. SudheeshSinganamalla will keep that in mind. Thanks again : — Dharmindar. The issue is because of the limit bytes. You need a loop to receive all the data and then join the byte chunks into the string you want.

Here is an example. You can easily search for these on stackoverflow. Please don't expect us to write everything. Show 6 more comments. Drusyc Drusyc 13 5 5 bronze badges. Add a comment. Sign up or log in Sign up using Google. Sign up using Facebook. Sign up using Email and Password. Post as a guest Name.

Email Required, but never shown. The Overflow Blog. Podcast Making Agile work for data science. Stack Gives Back Featured on Meta. New post summary designs on greatest hits now, everywhere else eventually. Linked Related Hot Network Questions.



0コメント

  • 1000 / 1000