[原创] python udt4 for windows appserver.py

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了[原创] python udt4 for windows appserver.py相关的知识,希望对你有一定的参考价值。

#coding: utf-8

import ctypes as _ctypes
from ctypes import wintypes as _wtypes
import threading
import time
import struct
import os
from udt4py import *

def worker(clientfd):
    print("worker===============")
    while  True:
        buf = udt_recv(clientfd)
        if buf is not None:
            print(buf)
    return


fd = udt_socket()

ret = udt_bind(fd,9000)
if ret < 0:
    print("bind failed")
    os._exit(0)
    
ret = udt_listen(fd)
if ret < 0:
    print("listen failed")
    os._exit(0)
    

print("listen 9000")
while True:
    (clientfd,clienthost,clientservice) = udt_accept(fd)
    if  clientfd >=0 :
        print(clienthost,clientservice)
        t = threading.Thread(target=worker,args=(clientfd,))
        t.start()
        
        

    
    

    

udt4py下载

以上是关于[原创] python udt4 for windows appserver.py的主要内容,如果未能解决你的问题,请参考以下文章

[原创] python udt4 for windows sendfile.py

First order of polyurethane resin for wind blades

[原创]K8Cscan for Python 2.0

python [IO] wind引入代码及股票名#tags:wind,code

python气象绘图windrose

想在wind中试验python接口,该怎么做到