Send packet python -
how in python? this.
packetbuffer[0] := $00; packetbuffer[1] := $12; packetbuffer[2] := $12; 'sendpacket(processid, @packetbuffer, true, false);'
use socket module:
import socket s = socket.socket(socket.af_inet, socket.sock_stream) s.connect((your_host, your_port)) msg_to_send = 'whatever' num_sent = 0 while num_sent < len(msg_to_send): sent = s.send(msg_to_send[num_sent:]) if sent == 0: raise runtimeerror("socket connection broken") num_sent += sent
Comments
Post a Comment