| Reply | « Previous Thread | Next Thread » |
|
hi,
How can I share an object of type socket between two threads? thanks |
|
Join Date: Nov 2007
Posts: 318
Location: Sertaozinho/Brazil
marcelobarrosalmeida
Online
Forum Nokia Champion
|
|
|
Quote:
Code:
from threading import Thread
from socket import *
from time import sleep
# worker task
def tsk(s):
print "socket", s
i = 5
while i > 0:
i -= 1
sleep(1)
s = socket(AF_INET,SOCK_STREAM)
# put other socket stuff here, like connection
# ...
# creating threads
t1 = Thread(target=tsk,args=(s,))
t2 = Thread(target=tsk,args=(s,))
t1.start()
t2.start()
# waiting thread finalization
t1.join()
t2.join()
Marcelo Barros Nokia E71, N800, N95 and XM 5800 http://www.croozeus.com http://wordmobi.wordpress.com http://jedizone.wordpress.com |
|
hi marcelobarrosalmeida,
But python S60 supports threading module? thanks |
|
Join Date: Nov 2007
Posts: 318
Location: Sertaozinho/Brazil
marcelobarrosalmeida
Online
Forum Nokia Champion
|
|
|
Quote:
![]() Marcelo Marcelo Barros Nokia E71, N800, N95 and XM 5800 http://www.croozeus.com http://wordmobi.wordpress.com http://jedizone.wordpress.com |
| Reply | « Previous Thread | Next Thread » |
| Thread Tools | Search this Thread |
|---|---|
| Rate This Thread | |
| Thread | Thread Starter | Forum | Replies | Last Post |
|---|---|---|---|---|
| help~~~about the CMdaAudioInputStream | Dragon_L | Symbian Media (Graphics & Sounds) | 14 | 2008-11-05 07:11 |
| Using sockets in the fullduplex example | niranjancsc | Symbian Media (Graphics & Sounds) | 1 | 2007-03-22 13:52 |
| How to send HBufC8 over sockets? | niranjancsc | Symbian Networking & Messaging | 16 | 2007-02-18 08:16 |
| Questions about sockets, I need help. | _fox | Symbian Networking & Messaging | 0 | 2004-06-10 11:29 |
| Where to find application that uses sockets? | doctordwarf | Mobile Java General | 1 | 2004-03-10 16:45 |