chinye2020
January 11th, 2013, 01:01 AM
import socket
import sys
import datetime
import os
try:
username = "root"
password = "Apacheah64"
db_name = "DB_GPS"
table_name = "Tbl_GPS"
host = ""
port = 6903
buf = 4096
except IndexError:
sys.exit(1)
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
s.bind((host, port))
while 1:
data = s.recv(buf)
if not data:
print("Client has exited!")
break
else:
print("\nReceived message '", data,"'")
# Close socket
s.close()the bytes i m received should be 43 bytes, but what i received from client is
Received message ' b'\x0f\x00\x00\x00NR09G05164\x00' ' ?
only 15 bytes. why?
import sys
import datetime
import os
try:
username = "root"
password = "Apacheah64"
db_name = "DB_GPS"
table_name = "Tbl_GPS"
host = ""
port = 6903
buf = 4096
except IndexError:
sys.exit(1)
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
s.bind((host, port))
while 1:
data = s.recv(buf)
if not data:
print("Client has exited!")
break
else:
print("\nReceived message '", data,"'")
# Close socket
s.close()the bytes i m received should be 43 bytes, but what i received from client is
Received message ' b'\x0f\x00\x00\x00NR09G05164\x00' ' ?
only 15 bytes. why?