Python UDP sockets

Discuss the development of new homebrew software, tools and libraries.

Moderators: cheriff, TyRaNiD

Post Reply
kimbl
Posts: 3
Joined: Mon May 08, 2006 11:42 am

Python UDP sockets

Post by kimbl »

I'm trying to put together a simple app in PSP python to send UDP messages whenever a button is pressed. I've got a simple app that displays buttonpresses on screen, but whenever I actually try to send the packet it crashes out (PSP turns off and needs a restart).

socket library seems to import ok, and the socket object is created in UDP mode, but the following kills it:

sock.sendto('down',('192.168.0.103',999))

The script runs fine on the PC using PC python with the psp2d and pspnet libraries - it even talks properly to my remote listening app!

Anyone else had problems with UDP under PSP python?
User avatar
Drakonite
Site Admin
Posts: 990
Joined: Sat Jan 17, 2004 1:30 am
Contact:

Post by Drakonite »

Moved.

Make sure you post in the right forums next time, or I'll start deleting things.
Shoot Pixels Not People!
Makeshift Development
kimbl
Posts: 3
Joined: Mon May 08, 2006 11:42 am

Post by kimbl »

Apologies - 3am finger trouble...
johnsto
Posts: 30
Joined: Wed Jan 18, 2006 8:52 am

Post by johnsto »

Have you tried a different port? Just a complete shot in the dark, but try something much much higher (I seem to recall something about ports < 1024 being reserved)
User avatar
dot_blank
Posts: 498
Joined: Wed Sep 28, 2005 8:47 am
Location: Brasil

Post by dot_blank »

correct ...a nmap scan would reveal all that is reserved
10011011 00101010 11010111 10001001 10111010
kimbl
Posts: 3
Joined: Mon May 08, 2006 11:42 am

Post by kimbl »

Good thought - unfortunately I originally started with port 8000, and only came down to 999 after reading a bit of sample code somewhere. I can't get either to work...

I fear I may have to learn Lua after all to get this done - shame - I much prefer Python!
Post Reply