www.digitalmars.com         C & C++   DMDScript  

D - Help needed with socket.d

reply "Christian Lesage" <christian.lesage.1 agora.ulaval.ca> writes:
Hi folks!

D seems to have most important features I want in a language: garbage
collection, strings, dynamic arrays and associative arrays. I've used
scripting
languages until now because they had these features, but I always wished
there was a compiled language which would offer them. Then, I think D
deserves a try.

Easy TCP/IP is another feature I need. Pavel Minayev created the D sockets
library, "a set of classes encapsulating Windows Sockets 2 functionality".
Great. Mike Wynn posted his fixes to this library on January 23, 2003. This
is the file I am reposting here.

Now, here's my problem. Even using Mike's "socket.d", I can't compile
Pavel's example "httpget.d". The compiler yields:

C:\Program Files\DIDE\Projects\httpget\httpget.d(21): cannot create instance
of abstract class TCPSocket

Also, I think that I have to link the whole thing with "ws2_32.lib", but how
can I get this done?

I guess my questions will seem trivial to some of you. However, I would
really appreciate some help. BTW, I'm using DIDE.

Christian Lesage



begin 666 socket.d
M+RHA#0H *B!3;V-K971S(&9O<B!$#0H *B!#;W!Y<FEG:'0 *&,I(#(P,#( 
M4&%V96P (D5V:6Q/;F4B($UI;F%Y978-"B J($-O<'ER:6=H=" H8RD ,C P
M,R!-:6ME(%=Y;FX /&UI:V4N=WEN;D!L.&YI9VAT+F-O+G5K/ T*("H-"B J
M(%!E<FUI<W-I;VX =&\ =7-E+"!C;W!Y+"!M;V1I9GDL(&1I<W1R:6)U=&4 
M86YD('-E;&P =&AI<R!S;V9T=V%R90T*("H 86YD(&ET<R!D;V-U;65N=&%T
M:6]N(&9O<B!A;GD <'5R<&]S92!I<R!H97)E8GD 9W)A;G1E9"!W:71H;W5T
M(&9E92P-"B J('!R;W9I9&5D('1H870 =&AE(&%B;W9E(&-O<'ER:6=H="!N
M;W1I8V4 87!P96%R(&EN(&%L;"!C;W!I97, 86YD#0H *B!T:&%T(&)O=&  
M=&AA="!C;W!Y<FEG:'0 ;F]T:6-E(&%N9"!T:&ES('!E<FUI<W-I;VX ;F]T
M:6-E(&%P<&5A< T*("H :6X <W5P<&]R=&EN9R!D;V-U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#0H)<')O=&5C=&5D
M(%-/0TM%5"!S;V-K970 /2!C87-T*%-/0TM%5"DP.PT*"0T*"2\O(&)I;F1S
M(&]B:F5C="!T;R!A;B!E>&ES=&EN9R!S;V-K970[('5S92!W:71H(&-A<F4A
M"0T*"71H:7,H4T]#2T54(',L(&)I="!C;VYN96-T960I#0H)>PT*"0ES;V-K
M970 /2!S.PT*"0ER96%D86)L92 ]('=R:71E86)L92 ](&-O;FYE8W1E9#L-
M" E]#0H-" ET:&ES*"D >WT-" T*"0T*"2\O(')E='5R;G, =')U92!I9B!S
M;V-K970 :7, 8V]N;F5C=&5D+"!F86QS92!O=&AE<G=I<V4-" EB:70 8V]N
M;F5C=&5D*"D-" E[#0H)"75I;G0 ;F( /2 Q.PT*"0EI;V-T;'-O8VME="AS
M;V-K970L($9)3TY"24\L("9N8BD[#0H)"6-H87( 8G5F.PT*"0EI;G0 <F5S
M=6QT(#T <F5C=BAS;V-K970L("9B=68L(#$L($U31U]0145+*3L-" D):6YT
M(&5R<B ](%=304=E=$QA<W1%<G)O<B I.PT*"0EN8B ](# [#0H)"6EO8W1L
M<V]C:V5T*'-O8VME="P 1DE/3D))3RP )FYB*3L-" D):68 *')E<W5L=" ]
M/2!33T-+151?15)23U(I#0H)"0ER971U<FX *&5R<B ]/2!74T%%5T]53$1"
M3$]#2RD[#0H)"65L<V4-" D)"7)E='5R;B H<F5S=6QT(3TP*3L-" E]#0H)
M#0H)+R\ 9&ES8V]N;F5C=', =&AE('-O8VME= T*"79O:60 9&ES8V]N;F5C
M=" I#0H)>PT*"0EI9B H<V]C:V5T*0T*"0E[#0H)"0ES:'5T9&]W;BAS;V-K
M970L(%-$7T)/5$ I.PT*"0D)8VQO<V5S;V-K970H<V]C:V5T*3L-" D)"7)E
M861A8FQE(#T =W)I=&5A8FQE(#T 9F%L<V4[#0H)"0ES;V-K970 /2!C87-T
M*%-/0TM%5"DP.PT*"0E]#0H)?0T*#0H)+R\ <F5T=7)N<R!T<G5E(&EF('1H
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97-U;'0[#0H)?0T*#0H);W9E<G)I9&4 =6EN="!W<FET94)L;V-K*'9O
M:60J(&)U9F9E<BP =6EN="!S:7IE*0T*"2\O('-I;F-E(&EN+6)L;V-K<R!A
M<F4 ;F]T(&EN:&5R:71E9"P <F5D969I;F4 =&AE;0T*"6EN#0H)>PT*"0EA
M<W-E<G0H=W)I=&5A8FQE*3L-" E]#0H)8F]D>0T*"7L-" D):6YT(')E<W5L
M=" ]('-E;F0H<V]C:V5T+"!C87-T*&-H87(J*2!B=69F97(L('-I>F4L(# I
M.PT*"0EI9B H<F5S=6QT(#T](%-/0TM%5%]%4E)/4BD-" D)"71H<F]W(&YE
M=R!7<FET945R<F]R*")S;V-K970 9F%I;&5D('1O('-E;F0 9&%T82(I.PT*
M"0EE;'-E#0H)"0ER971U<FX <F5S=6QT.PT*"7T-" D-" EO=F5R<FED92!B
M:70 96]F*"D-" E[#0H)"7)E='5R;B A8V]N;F5C=&5D*"D[#0H)?0T*?0T*
M#0HO+R!)4"!A9&1R97-S#0IC;&%S<R!)4 T*>PT*"75N:6]N($UY50T*"7L-
M" D)=6)Y=&5;-%T 8CL-" D)=6EN="!A9&1R97-S.R O+R ](# [#0H)?0T*
M"4UY52!I<&%D9'([#0H)#0H)=&AI<R I('L ?0T*"0T*"71H:7,H25  :7 I
M#0H)>PT*"0EI<&%D9'(N861D<F5S<R ](&EP+FEP861D<BYA9&1R97-S.PT*
M"7T-" D-" ET:&ES*'5I;G0 861D<BD-" E[#0H)"6EP861D<BYA9&1R97-S
M(#T 861D<CL-" E]#0H)#0H)=&AI<RAU8GET92!B,2P =6)Y=&4 8C(L('5B
M>71E(&(S+"!U8GET92!B-"D-" E[#0H)"6EP861D<BYB6S!=(#T 8C$[(&EP
M861D<BYB6S%=(#T 8C([(&EP861D<BYB6S)=(#T 8C,[(&EP861D<BYB6S-=
M(#T 8C0[#0H)?0T*"0T*"2\O(')E<V]L=F5S($E0(&%D9')E<W, 9G)O;2!H
M;W-T;F%M92P =&A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)>PT*"0EW:6YS;V-K+FQI<W1E;BAS;V-K970L(&)A8VML;V<I.PT*
M"0EM7VQI<W1E;FEN9R ]('1R=64[#0H)?0T*"0T*"2\O(')E='5R;G, =')U
M92!I9B!S;V-K970 :7, ;&ES=&5N:6YG+"!F86QS92!O=&AE<G=I<V4-" EB
M:70 ;&ES=&5N:6YG*"D >R!R971U<FX ;5]L:7-T96YI;F<[('T-" T*"2\O
M('-H=71S(&1O=VX =&AE('-E<G9E< T*"79O:60 <VAU=&1O=VXH*0T*"7L-
M" D):68 *'-O8VME="D-" D)>PT*"0D)=VEN<V]C:RYS:'5T9&]W;BAS;V-K
M970L(%-$7T)/5$ I.PT*"0D)8VQO<V5S;V-K970H<V]C:V5T*3L-" D)"6U?
M;&ES=&5N:6YG(#T 9F%L<V4[#0H)"0ES;V-K970 /2!C87-T*%-/0TM%5"DP
M.PT*"0E]#0H)?0T*"0T*"2\O(')E='5R;G, =')U92!I9B!T:&5R92!A<F4 
M<&5N9&EN9R!C;VYN96-T:6]N<RP 9F%L<V4 ;W1H97)W:7-E#0H)8FET(&-O
M;FYE8W1I;VYS*"D-" E[#0H)"7-T871I8R!T:6UE=F%L('1V(#T >R P+" P
M('T[#0H)"69D7W-E="!F9#L-" D)1D1?6D523R F9F0I.PT*"0E&1%]3150H
M<V]C:V5T+" F9F0I.PT*"0ER971U<FX <V5L96-T*# L("9F9"P ;G5L;"P 
M;G5L;"P )G1V*2 ^(# [#0H)?0T*?0T*#0HO+R!40U  <V5R=F5R#0IC;&%S
M<R!40U!397)V97(Z(%-E<G9E<E-O8VME= T*>PT*"7!R:79A=&4 8FET(&U?
M8VQI96YT5&AR96%D<R ](&9A;'-E.PT*#0H)=&AI<R I('L ?0T*"0T*"71H
M:7,H=7-H;W)T(' I('L <&]R="AP*3L ?0T*"0T*"2\O(&-R96%T97, =&AE
M('-O8VME="!A;F0 8FEN9', :70 =&\ 82!S<&5C:69I8R!P;W)T#0H)=F]I
M9"!P;W)T*"!U<VAO<G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V97([#0H)"5-T<F5A;5-O8VME="!S;V-K970[
M#0H)"4EN=&5R;F5T061D<F5S<R!I83L-" E]#0H)"0T*"7!R:79A=&4 97AT
M97)N*$,I('-T871I8R!V;VED(&-O;FYE8W1I;VY4:')E860H=F]I9"H 87)G
M*0T*"7L-" D)8V]N;E]D871A(&-N(#T 8V%S="AC;VYN7V1A=&$I(&%R9SL-
M" D)8VXN<V5R=F5R+F]N0V]N;F5C=&EO;BAC;BYS;V-K970L(&-N+FEA*3L-
M" E]#0H-" EP<FEV871E(&5X=&5R;BA#*2!S=&%T:6, =F]I9"!B9U-E<G9E
M<E1H<F5A9"AV;VED*B!A<F<I#0H)>PT*"0E40U!397)V97( <W9R(#T 8V%S
M="A40U!397)V97(I(&%R9SL-" D)<W9R+G-E<G9E<DQO;W H*3L-" E]#0I]
M#0H-"B\O(&-O;FYE8W1I;VYL97-S+"!M97-S86=E+6]R:65N=&5D('-O8VME
M=', *%=I;E-O8VLR(%-/0TM?1$=204TI#0IC;&%S<R!$871A9W)A;5-O8VME
M= T*>PT*"7!R;W1E8W1E9"!33T-+150 <V]C:V5T.PT*#0H)?G1H:7,H*0T*
M"7L-" D)<VAU=&1O=VXH<V]C:V5T+"!31%]"3U1(*3L-" D)8VQO<V5S;V-K
M970H<V]C:V5T*3L-" E]#0H-" DO+R!R971U<FYS('1R=64 :68 =&AE<F4 
M:7, <F5C96EV960 9&%T82!I;B!T:&4 8G5F9F5R+"!S;PT*"2\O(&-A;&P 
M=&\ <F5A9"!F=6YC=&EO;G, =VEL;"!N;W0 8FQO8VLL(&9A;'-E(&]T:&5R
M=VES90T*"6)I="!D871A4F5C96EV960H*0T*"7L-" D)<W1A=&EC('1I;65V
M86P ='8 /2![(# L(#  ?3L-" D)9F1?<V5T(&9D.PT*"0E&1%]:15)/*"9F
M9"D[#0H)"49$7U-%5"AC87-T*%-/0TM%5"D <V]C:V5T+" F9F0I.PT*"0ER
M971U<FX <V5L96-T*# L("9F9"P ;G5L;"P ;G5L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!B92!T:&4-
M" DO+R!A8W1U86P <VEZ92!O9B!T:&4 9&%T86=R86TI.R!T:')O=W, 4F5A
M9$5R<F]R(&]N(&9A:6QU<F4-" EU:6YT(')E8W9&<F]M*$EN=&5R;F5T061D
M<F5S<R!I82P =F]I9"H 8FQO8VLL(&EN="!S:7IE*0T*"7L-" D)<V]C:V%D
M9')?:6X <V$[#0H)"6EN="!S86QE;B ]('-A+G-I>F4[#0H)"6EN="!R97-U
M;'0 /2!R96-V9G)O;2AS;V-K970L(&-A<W0H8VAA<BHI(&)L;V-K+"!S:7IE
M+ T*"0D),"P 8V%S="AS;V-K861D<BHI("9S82P )G-A;&5N*3L-" D):68 
M*')E<W5L=" ]/2!33T-+151?15)23U(I#0H)"7L-" D)"6EF("A74T%'971,
M87-T17)R;W(H*2 ]/2!74T%%35-'4TE:12D-" D)"0ER97-U;'0 /2!S:7IE
M("L ,3L-" D)"65L<V4-" D)"0ET:')O=R!N97< 4F5A9$5R<F]R*")S;V-K
M970 9F%I;&5D('1O(')E8V5I=F4 9&%T86=R86TB*3L-" D)?0T*"0EI82YI
M<"YI<&%D9'(N861D<F5S<R ]('-A+G-I;E]A9&1R+G-?861D<CL-" D):6$N
M<&]R=" ](&YT;VAS*'-A+G-I;E]P;W)T*3L-" D)<F5T=7)N(')E<W5L=#L-
M" E]#0I]#0H-"B\O('-T<F5A;2 H5$-0*2!S;V-K971S(&%R92!U<V5D(&UO
M<F4 9G)E<75E;G1L>2P-"B\O('-O('-U8V  86X 86QI87, <V5E;7, ;&]G
 :6-A; T*86QI87, 4W1R96%M4V]C:V5T(%-O8VME=#L`
`
end
Oct 06 2003
parent reply "Lars Ivar Igesund" <larsivi stud.ntnu.no> writes:
"Christian Lesage" <christian.lesage.1 agora.ulaval.ca> wrote in message
news:bltn3k$27vo$1 digitaldaemon.com...
 Now, here's my problem. Even using Mike's "socket.d", I can't compile
 Pavel's example "httpget.d". The compiler yields:

 C:\Program Files\DIDE\Projects\httpget\httpget.d(21): cannot create
instance
 of abstract class TCPSocket
There was a recent change in the compiler that disallows instantiation of abstract classes. It means that the code must be fixed. You might find more about it in the docs. Lars Ivar Igesund
Oct 07 2003
parent reply "Christian Lesage" <christian.lesage.1 agora.ulaval.ca> writes:
 There was a recent change in the compiler that disallows instantiation of
 abstract
 classes. It means that the code must be fixed. You might find more about
it
 in
 the docs.
Thanks for replying. I feel like I am closer to the solution. However, the documentation doesn't tell much about "abstract" classes. Yet Another Stupid Question: What's an "abstract" class? How do you differenciate an "abstract" class from a "concrete" one? TCPSocket looks like a "concrete" class to me. It has a polymorphic constructor and a polymorphic member function "connect()". BTW, I post "httpget.d", just in case somebody feeling particularly generous have time to look into the problem... ;) begin 666 HTTPGET.D M+RH-"B J(%-I;7!L:7-T:6, 2%144"!C;&EE;G0 <V%M<&QE('=R:71T96X M:6X 1 T*("H 0V]P>7)I9VAT("AC*2 R,# R(%!A=F5L(")%=FEL3VYE(B!- M:6YA>65V#0H * T*("H 4&5R;6ES<VEO;B!T;R!U<V4L(&-O<'DL(&UO9&EF M>2P 9&ES=')I8G5T92!A;F0 <V5L;"!T:&ES('-O9G1W87)E#0H *B!A;F0 M:71S(&1O8W5M96YT871I;VX 9F]R(&%N>2!P=7)P;W-E(&ES(&AE<F5B>2!G M<F%N=&5D('=I=&AO=70 9F5E+ T*("H <')O=FED960 =&AA="!T:&4 86)O M=F4 8V]P>7)I9VAT(&YO=&EC92!A<'!E87( :6X 86QL(&-O<&EE<R!A;F0- M"B J('1H870 8F]T:"!T:&%T(&-O<'ER:6=H="!N;W1I8V4 86YD('1H:7, M<&5R;6ES<VEO;B!N;W1I8V4 87!P96%R#0H *B!I;B!S=7!P;W)T:6YG(&1O M8W5M96YT871I;VXN("!!=71H;W( ;6%K97, ;F\ <F5P<F5S96YT871I;VYS M(&%B;W5T#0H *B!T:&4 <W5I=&%B:6QI='D ;V8 =&AI<R!S;V9T=V%R92!F M;W( 86YY('!U<G!O<V4N($ET(&ES('!R;W9I9&5D#0H *B B87, :7,B('=I M=&AO=70 97AP<F5S<R!O<B!I;7!L:65D('=A<G)A;G1Y+ T*("HO#0H #0II M;7!O<G0 8RYS=&1I;RP <V]C:V5T.PT*#0IC;VYS="!C:&%R6UT 861D<B ] M(")W=W<N9&EG:71A;&UA<G,N8V]M(CL-"F-O;G-T(&EN="!P;W)T(#T .# [ M#0H-"FEN="!M86EN*"D-"GL-" E40U!3;V-K970 <R ](&YE=R!40U!3;V-K M970H861D<BP <&]R="D[#0H)#0H)8VAA<ELR,#!=(')E<75E<W0[#0H):6YT M(&QE;B ]('-P<FEN=&8H<F5Q=65S="P (D=%5" O($A45% O,2XP7&Y(3U-4 M("4N*G,Z)61<;EQN(BP 861D<BP <&]R="D[#0H)<RYW<FET95-T<FEN9RAR M97%U97-T6S +BX ;&5N72D[#0H)#0H)<')I;G1F*")$;W=N;&]A9&EN9R(I M.PT*"0T*"6-H87);72!F:6QE.PT*"6EN="!C;W5N=" ](# [#0H)=VAI;&4 M*',N8V]N;F5C=&5D*"DI#0H)>PT*"0EF:6QE('X](',N<F5A9%-T<FEN9R Q M*3L-" D):68 *"LK8V]U;G0 /B Q,#(T*0T*"0E[#0H)"0EP<FEN=&8H(BXB M*3L-" D)"6-O=6YT(#T ,#L-" D)?0T*"7T-" D-" EP<FEN=&8H(B4N*G-< :;B(L(&9I;&4I.PD-" ER971U<FX ,#L-"GT` ` end
Oct 07 2003
parent "Lars Ivar Igesund" <larsivi stud.ntnu.no> writes:
"Christian Lesage" <christian.lesage.1 agora.ulaval.ca> wrote in message
news:bluqpu$q19$1 digitaldaemon.com...
 What's an "abstract" class? How do you differenciate an "abstract" class
 from a "concrete" one? TCPSocket looks like a "concrete" class to me. It
has
 a polymorphic constructor and a polymorphic member function "connect()".
An abstract class is a crossing between an interface and a normal class. The methods can be implemented (but don't have to be). It should be used on classes (usually base classes in a hierarchy) that makes no sense to instantiate, but that it is nice to have some code that is common for all subclasses. abstract has the same meaning in Java, an explanation can be found here: http://java.sun.com/docs/books/tutorial/java/javaOO/abstract.html Lars Ivar Igesund
Oct 07 2003