[ NrmMyth @ 13.12.2006. 20:40 ] @
Ima li tko da radi ovdje s ACE bibliotekom. Trebam pomoc oko datagram socketa.

Code:
ACE_INET_Addr local( 1233 );
ACE_SOCK_Dgram server;

if (server.open (local) == -1)
        ACE_ERROR_RETURN( (LM_ERROR, "%p\n", "open server"), -1);

'open' vrati -1 s ovim errorom:
Code:
open server: WSA Startup not initialized


Gdje grijesim?
[ Buffy @ 13.12.2006. 21:30 ] @
U windowsu moras izvrsiti inicijalizaciju prije koristenja socketa.
Code:

#include <winsock2.h>
...
WSADATA d;
WSAStartup(MAKEWORD(2,0),//oznacava verziju socketa, u ovom slucaju 2.0
                 &d);
....
WSACleanup();

Ja nisam stavio provjeru da li je WSAStartup funkcija uspjesno izvrsena.
Pozdrav!

p.s. za detalje pogledaj msdn.
[ NrmMyth @ 14.12.2006. 06:03 ] @
Vec sam ja pokusavao napraviti svoju inicijalizaciju WSA, ali sam koristio "winsock.h" zbog cega mi je izbacivalo masu redefinitiona, vjerojatno zbog ACE-a.
Sad s winsock2.h nista... zasto?
[ X Files @ 14.12.2006. 07:26 ] @
http://tinyurl.com/yhty44
Citat:

No, because the other components have been coded to use winsock.h instead of
winsock2.h. You can't make winsock.h magically work like winsock2.h does.
Winsock2.h disables winsock.h if winsock2.h is included by the precompiler
first, so everything should be ok in that scenerio. However, if winsock.h
is included by the precompiler first, then winsock2.h produces duplicate
declarations because Microsoft did not write winsock2.h to not redeclare
everything that winsock.h already declares.

Had Microsoft been smart, they would have had winsock2.h simply include
winsock.h and then have winsock2.h declare only the new things that
winsock2.h actually adds that winsock.h does not have. But since when does
Microsoft actually act smart? They took winsock.h, duplicated everything
into winsock2.h, and then had winsock2.h disable winsock.h. Thus winsock2.h
does not work properly when winsock.h is included in a project first. I
suppose they did that thinking that everyone would simply replace all
occurances of winsock.h with winsock2.h and everything would be good, and
they would be right in that regard. But apparently, they did not take into
account what would happen when the two try to co-exist in the same project
together. Then all hell breaks out.

[ NrmMyth @ 14.12.2006. 13:36 ] @
k

Nije istina da ms stalno radi sranja, pogledajte novi DirectX, iznenadjujuce...