| Reply | « Previous Thread | Next Thread » |
|
Hello,
I am encountering an unexpected problem when I want to establish a connection to a remote server. I am still working on my ShoutCAST client: basically, you just need to send a GET request to the server, sort the header and stream the data. I've noticed, though, that my code only works when the shoutCAST server port is set to 80. Any other connection attempt fails. To be more precise, when I check the connection logs in my phone's "connectivity" folder, it appears a connection is set but only a few bytes are sent and received, every minute or so. ( for the record, I use pys60 on a nokia 6680 ) Here's a piece of code that should be working: invoking 'listen' with the arguments provided here *should* get you some headers from the MegaRock Radio shoutcast server and a few bytes of music in MP3 format. Code:
from socket import *
def listen(server, port, loc ):
socks = socket(AF_INET, SOCK_STREAM)
socks.connect((server, port))
request = u'GET ' + loc + ' \r\n\r\n'
socks.send(request)
print socks.recv(1024)
socks.close()
listen(u'205.188.215.228', 8012, u'/')
Code:
import httplib
def listen(server, port, loc ):
conn = httplib.HTTPConnection(server, port)
conn.request('GET', loc)
rep = conn.getresponse()
header, stream = rep.read(1024).split('\r\n\r\n')
print header
conn.close()
listen(u'205.188.215.228', 8012, u'/')
EDIT: Seems like my ISP is to blame. I wonder what I can do to change this ![]()
Last edited by MrKikkeli : 2006-03-26 at 17:00.
|
| Reply | « Previous Thread | Next Thread » |
| Thread Tools | Search this Thread |
|---|---|
| Rate This Thread | |
| Thread | Thread Starter | Forum | Replies | Last Post |
|---|---|---|---|---|
| Mobile-to-mobile transfer with J2ME sockets | jbrodie | Mobile Java Networking & Messaging & Security | 4 | 2005-11-18 12:55 |
| YUCCA Help : BT Sockets : Wierd Problem?? | mayur_24 | General Symbian C++ | 5 | 2004-09-20 13:18 |
| sockets example on 7650 | germm | Symbian Networking & Messaging | 6 | 2003-11-18 09:37 |
| Virtual Series Ports Driver on Laptop | smallfish_ntu | General Symbian C++ | 1 | 2003-07-18 07:06 |
| Virtual Series Ports Driver on Laptop | smallfish_ntu | Symbian Networking & Messaging | 0 | 2003-07-18 03:48 |