You Are Here:

Community: Developer Discussion Boards

#1 Old sockets and ports - 2006-03-26, 16:35

Join Date: Mar 2006
Posts: 29
MrKikkeli's Avatar
MrKikkeli
Offline
Registered User
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'/')
and the httplib version:
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'/')
If anyone can check whether those functions give the expected output or not, I'd be very interested by a feedback. Someone just told me on #pys60 that it's possible to open ports since a ssh client for pys60 exists... so I wonder what is to blame here ...

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 With Quote
Reply « Previous Thread | Next Thread »
Display Modes
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules

You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump
Similar Threads
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

Rate This

 
Bookmark this page: DeliciousDiggFacebookGoogleYahooStumbleUponRedditDiigoTechnocratiTwitter  Share this page Share this page Print this Page Print this page Invite a friend Invite a friend
京ICP备05048969号    Email Newsletters Press Terms & Conditions Privacy Policy Sitemap Contact Us © 2009 Nokia