Need Help with UDP Client Writing

misc client related stuff

Moderators: AniDB, AniDB API

Locked
0belisk
Posts: 2
Joined: Sun Feb 26, 2006 12:16 am

Need Help with UDP Client Writing

Post by 0belisk »

1)
Sorry all for creating this topic. Feel free to delete it. I know it's not a programming (or something similar) forum... but I'm afraid it's the only place where I can ask for a help with my problem.

2)
So.. I'm trying to write a simple client on VC++ (I've never been doing something like this before!). It's goal to get the certain file's information sending its size, anime title, ep number and funsubber group's name and receiving all the rest information (resolution, codecs...). Nothing more.
I'm using socket, sendto function and rcvfrom function in my program. I believe it's the only way. But after trying to send packet to "api.anidb.info" (port: 9000) I get WSAEACCES error (permission denied) and end with nothing. In other words my packets don't even reach the server.

The basis for the program was the sample code for "sendto function" from MSDN.

By the way I do register the client.

3)
People, who has already written a client using VC++, or who just knows where the problem is, please (I beg you!) could you help me? Maybe by giving me instruction "what to do 1st, what to do next" (like "call WSAStartup(), then create a socket").. or just by explaining what's wrong with it... Is there something I forgot about?

Thank you

P.S. sorry for my english... I have no practices at all.. that is why it's so bad... I hope it's not so difficult to read
epoximator
AniDB Staff
Posts: 379
Joined: Sun Nov 07, 2004 11:05 am

Post by epoximator »

1) np. it's perfectly ok to ask here.
2) i tested this: http://msdn.microsoft.com/library/defau ... ndto_2.asp
and it worked, just had to use the ip:
RecvAddr.sin_addr.s_addr = inet_addr("69.64.44.6");
look for 'gethostbyname'
3) you could use PracticalSocket, google it.

i have written a simple client in c++, and i was going to make it open source. just never got around to do it

edit: amesrc
0belisk
Posts: 2
Joined: Sun Feb 26, 2006 12:16 am

Post by 0belisk »

Thanks! It really helps :D
Locked