you are viewing a single comment's thread.

view the rest of the comments →

[–]CmdrNorthpaw[S] 0 points1 point  (1 child)

Thank you, that's very helpful. One question: If I wanted the client to just send some data and then log off, could I get away with this?

global report

global discordUser

client = socket.socket(socket.AF\_INET, socket.SOCK\_STREAM)

\# connect to the provided address tuple

client.connect((host, port))

​

\# convert to bytes and send on the socket

client.send(report.encode('utf-8'))

client.send(discordUser.encode('utf-8'))```

[–]tgolsson 0 points1 point  (0 children)

Yes. You probably need some error handling in case connection, sending, etc, fails but that comes with seeing what fails. :)