2012-01-30, 13:37
Over TCP you don't have to send a header and there's no authentication but it's more work for the client because you don't get "messages" but a stream so you need to count { and } to know when a JSON-RPC response (or a notification) is complete.
XBMC publishes both the TCP and HTTP port for JSON-RPC over zeroconf (but obviously only if it is enabled in XBMC) but I don't really know anything about zeroconf so I can't help you there.
EDIT: The TCP service is named _XBMC-JSONRPC and the HTTP service is named _XBMC-JSONRPC-H (I know the name sucks but the specification states that the name must not exceed 15 characters). So you can also use zeroconf to get the port of the webserver.
XBMC publishes both the TCP and HTTP port for JSON-RPC over zeroconf (but obviously only if it is enabled in XBMC) but I don't really know anything about zeroconf so I can't help you there.
EDIT: The TCP service is named _XBMC-JSONRPC and the HTTP service is named _XBMC-JSONRPC-H (I know the name sucks but the specification states that the name must not exceed 15 characters). So you can also use zeroconf to get the port of the webserver.