WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 11-19-2014, 06:52 AM
Alex Miranda Alex Miranda is offline
Member
 
Join Date: Mar 2014
Posts: 21
Sending a value by Thread

Hello everyone.
I'm using socket and thread on my code and I'm trying to get a value that I have received by thread and put it on my code. My variable is global, but I can't get the result out of the thread.

def recMsg():

global msg

try:
print "Conected!!"

while True:
ip = "localhost"
buffer= 1024
port= 8080
address= (ip,porta)

UDP = socket(AF_INET,SOCK_DGRAM)
UDP.bind(address)

# Recebe mensagens
msg, address= UDP.recvfrom(buffer)

# Encerra o socket
UDP.close()

except:
print "Error"


#Start Thread
try:
thread.start_new_thread(recMsg,())
except:
print "Thread error"


# I would like to print my result here
# print msg for example

Thanks for help me !
Reply With Quote
Reply

Thread Tools
Display Modes 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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Sending an email from Vizard starlingstm Vizard 0 01-22-2012 11:08 AM
Prioritize Director thread aznan Vizard 9 05-14-2008 09:57 AM
sending event markers to a monitoring computer mikestatic Vizard 3 01-26-2006 09:23 AM
Sending Objects With Pickle Vygreif Vizard 6 11-05-2005 02:42 PM
running into a thread limit tavaksai Vizard 4 10-27-2004 03:59 PM


All times are GMT -7. The time now is 02:32 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2019, vBulletin Solutions, Inc.
Copyright 2002-2018 WorldViz LLC