0

This is the error received:

raw_data, adrr = conn.recvfrom(65535)
socket.error: [Errno 10057] A request to send or receive data was disallowed because the socket is not connected and (when sending on a datagram socket using a sendto call) no address was supplied.

The code written:

while True:
 raw_data, adrr = conn.recvfrom(65535)
 dest_mac, src_mac, eth_proto, data= ethernet_frame(raw_data)
 print('\nEthernet Frame:')
 print('Destination:{},source:{}, Protocol:{}'.format(dest_mac, src_mac, eth_proto))
Smart Manoj
6,0836 gold badges45 silver badges66 bronze badges
asked Apr 28, 2017 at 3:21
7
  • It seems like you're getting the reason in the error. Perhaps it would be useful to post the connection object as well. My guess is the error is occurring there. Commented Apr 28, 2017 at 3:48
  • We need to code where you created the conn object. Commented Apr 28, 2017 at 3:59
  • ok. here it is: Commented Apr 28, 2017 at 4:08
  • conn = socket.socket(socket.AF_INET, socket.SOCK_STREAM) conn.bind(('', 9999)) Commented Apr 28, 2017 at 4:09
  • @Noah okay..thats exactly what the problem is. you should not say conn.recvfrom() the socket object. Instead it should be from where you accept data. Example : conn,addr =s.accept() data=conn.recv(100000) Same example is given in the below link : stackoverflow.com/questions/10005851/… Commented Apr 28, 2017 at 4:15

0

Know someone who can answer? Share a link to this question via email, Twitter, or Facebook.

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.