hi....
i have written a python script to update my current GPS position regularly......
here is my script

Code:
import sys

# Try to import 'btsocket' as 'socket' - ignore on versions < 1.9.x
try:
    sys.modules['socket'] = __import__('btsocket')
except ImportError:
    pass

# For v1.9.x - Import the 'btsocket' module as 'socket'
# For v1.4.x - Import 'socket' module
import socket

# Set up AP
apid = socket.select_access_point()
apo = socket.access_point(apid)
socket.set_default_access_point(apo)

# Now importing urllib should use 'btsocket' instead of 'socket' on v1.9.x
import urllib

import positioning
import time
import httplib
import sysinfo

requestor = {'type':'service', 'format':'application', 'data':'test_app'}
positioning.set_requestors([requestor])
conn = httplib.HTTPConnection("www.my_host.in")
while 1:
        pos = positioning.position(course=1, satellites=1)

        if pos and pos.has_key('position'):
               lat = pos['position']['latitude']
               lon = pos['position']['longitude']
               speed = pos['course']['speed']
               if speed > 0:
                     speedkmph = speed * 3.6
               else:
                     speedkmph = 0
               imei=sysinfo.imei()
               print "GPS:", lat, lon, speed, speedkmph
        params = urllib.urlencode({'lat': lat, 'lon': lon, 'imei': imei, 'speed' : speedkmph})
        headers = {"Content-type": "application/x-www-form-urlencoded", "Accept": "text/plain"}
        
        conn.request("POST", "/gbus/processbuslatlans.php", params, headers)
        
        conn.close()
        
        time.sleep(0.5)
this script is working fine and updating my position continuously...but after some time around 20-30min, the following error is occurring...

d_exec
script_namespace.namespace)
File "e:\python\project7.py", line 48, in <module>
conn.request("POST", "/gbus/processbuslatlans.php", params, headers)
File "newcore\Lib\httplib.py", line 866, in request File "newcore\Lib\httplib.py", line 889, in _send_request File "newcore\Lib\httplib.py", line 860, in endheaders File "newcore\Lib\httplib.py", line 732, in _send_output File "newcore\Lib\httplib.py", line 699, in send File "newcore\Lib\httplib.py", line 683, in connect
error: (60, 'Not a stream')
why does this error occur and how to debug it??