When i specified the bluetooth adapter's address like this:
while 1:
bt_socket=socket()
bt_socket.bind(("00:0A:3A:7A:70:BB",9))
advertise("Boobee Here!", bt_socket, OBEX)
obex.recvfile(bt_socket, "test.txt")
bt_socket.close()
something like this would happan:
Traceback (most recent call last):
File "test.py", line 5, in <module>
bt_socket.bind(("00:0A:3A:7A:70:BB",9))
File "<string>", line 5, in bind
socket.error: (98, 'Address already in use')
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
You mean if you get this error if you specify the adapter address instead of just using "" when calling bind()? I can't reproduce this myself. There should be no problem with providing the adapter address to bind().
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Yes, that's what I mean. It's all right when you run the program once, everything is ok, but problem shows up at second round when you specify the adapter address.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Suppose I want to receive files forever, this is the test program:
while 1:
bt_socket=socket()
bt_socket.bind(("",9))
advertise("Boobee Here!", bt_socket, OBEX)
obex.recvfile(bt_socket, "test.txt")
bt_socket.close()
When i specified the bluetooth adapter's address like this:
while 1:
bt_socket=socket()
bt_socket.bind(("00:0A:3A:7A:70:BB",9))
advertise("Boobee Here!", bt_socket, OBEX)
obex.recvfile(bt_socket, "test.txt")
bt_socket.close()
something like this would happan:
Traceback (most recent call last):
File "test.py", line 5, in <module>
bt_socket.bind(("00:0A:3A:7A:70:BB",9))
File "<string>", line 5, in bind
socket.error: (98, 'Address already in use')
You mean if you get this error if you specify the adapter address instead of just using "" when calling bind()? I can't reproduce this myself. There should be no problem with providing the adapter address to bind().
Yes, that's what I mean. It's all right when you run the program once, everything is ok, but problem shows up at second round when you specify the adapter address.
Ok, it's my fault, I figured out the problem myself, thank you.