I am new to objective C and I need to send a simple message via UDP. The server part is working cause it is implemented in C#.
The server code in C# is:
var server = new UdpClient(8585);
var groupEP = new IPEndPoint(IPAddress.Parse("192.168.0.120"),8585);
byte[] bytes = server.Receive(ref groupEP);
and the client part in c# is:
System.Net.Sockets.UdpClient client;
client = new System.Net.Sockets.UdpClient("192.168.0.120",8585);
client.Send(new byte[]{1,2,3,4},4);
how can I do the same client part in objective c? I know there are a lot of tutorials on the internet such as this library. when I import that library to my project I do not know how to instantiate a new object. I have tried:
[[GCDAsyncUdpSocket alloc] initWithSocketQueue:... ??? I don't know how to initialize it.
I will appreciate if someone can show me a simple example of how could I replicate the client part into objective c.