Skip to content
This repository was archived by the owner on Aug 25, 2024. It is now read-only.
This repository was archived by the owner on Aug 25, 2024. It is now read-only.

How to receive data from Udp #1

@Krishan93

Description

@Krishan93

How to receive data from the network through the UDP protocol. Particular port number 58000. could you help me

function ReceivedFromNetwork (idBinding, nPort, strData)
print("ReceivedFromNetwork",idBinding,nPort,strData)

g_Receivebuffer = g_Receivebuffer .. strData

end

function OnNetworkBindingChanged (idBinding, bIsBound)
if (idBinding == 6001) then
NetworkBound = bIsBound
end
if (NetworkBound == true) then

--  C4:CreateNetworkConnection (6001,"255.255.255.255")

C4:NetConnect (6001,58000,'UDP')
end
print (bIsBound)
end

function OnConnectionStatusChanged (idBinding, nPort, strStatus)
print("OnConnectionStatusChanged ",strStatus)

    if (idBinding == 6001) then
    if (strStatus == "ONLINE") then
        NetworkConnected = true
     elseif (strStatus == "OFFLINE") then
        NetworkConnected = false
   end

end
print (strStatus)

end

function go ()

   C4:SendToNetwork (6001,58000,"1_0001_7_80207920180186_1_1")

end

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions