samp listening to udp
#1

I have a problem with listening to udp connection, in visual basic i made a udp connection but when i connect to server over my application i dont get any debug, this is visual basic:

pawn Код:
Dim bytCommand As Byte() = New Byte() {}

                    Dim publisher As New Sockets.UdpClient()

                    publisher.Connect("192.168.1.103", 7775)
                    Dim sendbytes() As Byte = ASCII.GetBytes(TextBox1.Text)
                    publisher.Send(sendbytes, sendbytes.Length)

This is pawn:


pawn Код:
public OnGameModeInit()
{
    if(udpConnect("192.168.1.103", 7775))
    {
        printf("The server has been connected to ucp.");
    }

    SetGameModeText("Blank Script");
    AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
    return 1;
}

public onSocketReceiveData(Socket:id, remote_clientid, data[], data_len)
{
    print("Nova launcher konekcija"); // ovo ne ispisuje kada stisnem connect
    return 1;
}

stock udpConnect(ip[], port)
{
    Launcher = socket_create(UDP);
    return socket_connect(Launcher, ip, port);
}
Reply
#2

This isn't so much Scripting Help, but you should check with people whether you're allowed to actually do this.

There is a reason for it not responding.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)