s2.close() s3.close() s4.close() s5.close() s6.close() print "pass" sys.exit(0) time.sleep(0.5) if __name__ == "__main__": send_vid, recv_vid, send_aud, recv_aud, send_chat, recv_chat = Sock_Connect( ) base = Only_Video.Video() audio = sound_class.OnlyAudio() chat = class_chat.Chat() tlist = [] Send_Vid_Thread = threading.Thread(target=base.Get_Self_Img, args=(send_vid, )) Recv_Vid_Thread = threading.Thread(target=base.Recv_Data, args=(recv_vid, )) Send_Aud_Thread = threading.Thread(target=audio.Send_Sound, args=(send_aud, )) Recv_Aud_Thread = threading.Thread(target=audio.Get_Sound, args=(recv_aud, )) Send_Chat_Thread = threading.Thread(target=chat.send_msg, args=(send_chat, )) Recv_Chat_Thread = threading.Thread(target=chat.recv_msg,
import socket import sound_class import threading PORT1 = 5002 PORT2 = 5001 IP = "0.0.0.0" s1 = socket.socket() s2 = socket.socket() s1.bind((IP, PORT1)) s2.bind((IP, PORT2)) s1.listen(1) s2.listen(1) send, addr = s1.accept() recv, addr = s2.accept() audio = sound_class.OnlyAudio(send) audio2 = sound_class.OnlyAudio(recv) Send_Aud_Thread = threading.Thread(target=audio.Send_Sound) Recv_Aud_Thread = threading.Thread(target=audio2.Get_Sound) Send_Aud_Thread.start() Recv_Aud_Thread.start()
import socket import sound_class import threading PORT1 = 5001 PORT2 = 5002 IP = "192.168.30.29" s1 = socket.socket() s2 = socket.socket() s1.connect((IP, PORT1)) s2.connect((IP, PORT2)) audio = sound_class.OnlyAudio(s1) audio2 = sound_class.OnlyAudio(s2) Send_Aud_Thread = threading.Thread(target=audio.Send_Sound) Recv_Aud_Thread = threading.Thread(target=audio2.Get_Sound) Send_Aud_Thread.start() Recv_Aud_Thread.start()