.sendto() method does not work on windows
Hi,
I developed a sikuli python script on linux that uses this code:
from socket import AF_INET, SOCK_DGRAM
import sys
import socket
import struct, time
host = "pool.ntp.org"
port = 123
buf = 1024
address = (host,port)
msg = '\x1b' + 47 * '\0'
# reference time (in seconds since 1900-01-01 00:00:00)
TIME1970 = 2208988800L # 1970-01-01 00:00:00
# connect to server
client = socket.socket( AF_INET, SOCK_DGRAM)
client.sendto(msg, address)
msg, address = client.recvfrom( buf )
t = struct.unpack( "!12I", msg )[10]
t -= TIME1970
current_time = time.ctime(
The code is working fine under linux, but if I use sikulix on windows it crashes (at line => client.sendto(msg, address) ) with the following error:
[error] script [ Sikuli_
[error] _socket.error ( [Errno -1] Unmapped exception: java.util.
[error] --- Traceback --- error source first line: module ( function ) statement 359: _socket ( handle_exception ) _socket.error: [Errno -1] Unmapped exception: java.util.
995: _socket ( sendto ) File "C:\Users\
[error] --- Traceback --- end --------------
Any idea why and how to fix it?
Question information
- Language:
- English Edit question
- Status:
- Expired
- For:
- SikuliX Edit question
- Assignee:
- No assignee Edit question
- Last query:
- Last reply: