Some devices have security settings built into them that prevent you making socket connections. On some devices there are workarounds (see below), while on others you are currently stuck (however see http proxying).
You most likely have a device security problem is you see one of the following messages:
If there are no workarounds described below please try to determine more about the problem by trying the following:
You may also encounter device security problems if you try to connect to a forbidden port. Forbidden ports are often 80 and 443, as these are only supposed to be connected to with HTTP connections not with socket connections. This is true on SonyEricsson.
Cingular MIDP2 firmwares disallow socket connections for all applications not signed by Cingular (or possibly the device manufacturer).