Navigacija
Lista poslednjih: 16, 32, 64, 128 poruka.

ACE socket problem

[es] :: C/C++ programiranje :: ACE socket problem

[ Pregleda: 3284 | Odgovora: 4 ] > FB > Twit

Postavi temu Odgovori

Autor

Pretraga teme: Traži
Markiranje Štampanje RSS

NrmMyth
Ivan Maček
Split

Član broj: 63456
Poruke: 849
*.adsl.net.t-com.hr.

Sajt: www.dump.hr


Profil

icon ACE socket problem13.12.2006. u 20:40 - pre 182 meseci
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?
 
Odgovor na temu

Buffy
Stanko Culaja
Sipovo, BiH

Član broj: 45310
Poruke: 312
*.teol.net.



Profil

icon Re: ACE socket problem13.12.2006. u 21:30 - pre 182 meseci
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.
 
Odgovor na temu

NrmMyth
Ivan Maček
Split

Član broj: 63456
Poruke: 849
*.adsl.net.t-com.hr.

Sajt: www.dump.hr


Profil

icon Re: ACE socket problem14.12.2006. u 06:03 - pre 182 meseci
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?
 
Odgovor na temu

X Files
Vladimir Stefanovic
Pozarevac

SuperModerator
Član broj: 15100
Poruke: 4890
*.tekostolac.co.yu.

Jabber: xfiles@elitesecurity.org


+633 Profil

icon Re: ACE socket problem14.12.2006. u 07:26 - pre 182 meseci
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.

 
Odgovor na temu

NrmMyth
Ivan Maček
Split

Član broj: 63456
Poruke: 849
*.adsl.net.t-com.hr.

Sajt: www.dump.hr


Profil

icon Re: ACE socket problem14.12.2006. u 13:36 - pre 182 meseci
k

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

[es] :: C/C++ programiranje :: ACE socket problem

[ Pregleda: 3284 | Odgovora: 4 ] > FB > Twit

Postavi temu Odgovori

Navigacija
Lista poslednjih: 16, 32, 64, 128 poruka.