Sign in to follow this  
Followers 0
Lord_Doominik

UDPSend

6 posts in this topic

Is it possible to send an mp3-file via udp?

this is the code we got now:

UDPStartup()

$socket = UDPOpen("127.0.0.1", 65532)

While 1
    $file = FileOpen("01 - Korn - Twist.mp3", 0)
    $read = FileRead($file)
    UDPSend($socket, String($read))
    FileClose($file)
    If Not @error then 
        Exit
    EndIf
WEnd

;;This is the UDP Server
;;Start this first

; Start The UDP Services
;==============================================
UDPStartup()

; Bind to a SOCKET
;==============================================
$socket = UDPBind("127.0.0.1", 65532)
If @error <> 0 Then Exit

While 1
    $data = UDPRecv($socket, 50)
    Hex($data)
    If $data <> "" Then
        MsgBox(0, "UDP DATA", $data)
        $write = FileOpen("Incoming/test.mp3", 2)
        FileWrite($write, $data)
        FileClose($write)
        
        UDPCloseSocket($socket)
        UDPShutdown()
        Exit
    EndIf
    sleep(100)
WEnd

Share this post


Link to post
Share on other sites



i have the same problem too.... can't anyone help?

[font="Verdana"]In work:[list=1][*]InstallIt[*]New version of SpaceWar[/list] [/font]

Share this post


Link to post
Share on other sites

bump o.O

no idea?

Share this post


Link to post
Share on other sites
is there a way to read the binary of a file and savin a binarystring to an file?

[font="Verdana"]In work:[list=1][*]InstallIt[*]New version of SpaceWar[/list] [/font]

Share this post


Link to post
Share on other sites

I am working on it, please be patient, look up on the other topics for TCP File Sending as they would work with some UDP tinkering, otherwise I will be done with my method soon.

- AutoIt Smith

Share this post


Link to post
Share on other sites

hm, there aren't topics for file sending over tcp... jsut for sending commands, msg's, etc....

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0