import select import socket import sys import Queue import serial try : server = socket.socket(socket.AF_INET, socket.SOCK_STREAM) server.connect(("192.168.10.109",2404)) serFd = serial.Serial() serFd.baudrate = 115200 serFd.port = "COM6" serFd.open() inputs = [ server,serFd] outputs = [ ] print type(server) print type(serFd) except Exception as e : print "Exception : ",e while inputs: try : readable, writable, exceptional = select.select(inputs, outputs, inputs) except Exception as e : print "select Exception : ",select.error break try : for s in readable : if s is server: print "s is : sockFd" data = s.recv(1024) print data elif s is serFd : print "s is : serFd" data1 = serFd.readline() print data1 except Exception as e : print "Exception : ",e break
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)