[原创] python udt4 for windows sendfile.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 *


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)
        udt_sendfile(clientfd)
        

    
    
    

udt4py下载

posted @ 2017-10-12 22:24  未命名blogs  阅读(189)  评论(0编辑  收藏  举报