You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
hi There, upon running the codes below, i have the problem in the last 2 lines : sock.sendto(message.format(i, time.asctime()), server_address) TypeError: a bytes-like object is required, not 'str'
#227
Import Module
import socket
import time
Create a TCP/IP socket
sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
Connect the socket to the port where the server is listening
server_address = ("localhost", 10000)
print('[+] Connecting to %s Port %s' % server_address)
message="Message No. {} | Sent By Client At Time {} "
for i in range(15):
sock.sendto(message.format(i, time.asctime()), server_address)
The text was updated successfully, but these errors were encountered: