FIXED : Bind a socket
Michalis Kabrianis
kabrianis at hellug.gr
Thu May 4 12:57:49 EEST 2000
On 04-May-2000 Constantinos A. Kotsokalis wrote:
<snip>
Costa to stelnw kai stin lista, gia na mathainoun kai oi alloi apo ta dika mou
lathi :-)
>>if (sock=socket(AF_INET, SOCK_STREAM, 0) < 0 ) {
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>
> Michalh, to la8os sou einai edw. Exeis 3exasei tis paren8eseis,
> opws kai pio katw (sth bind). To swsto einai:
> if ((sock=socket(AF_INET, SOCK_STREAM, 0)) < 0 )
> kai antistoixa pio katw
> if ((bound=bind(sock, (struct sockaddr *) &insock, sizeof(insock))) < 0 )
>
Exeis apolyto dikio.
> To problhma einai oti sthn klhsh ths socket() to sock den pairnei
> thn timh pou epistrefei h socket, alla (ypo8etw) thn timh 0 pou
> einai to apotelesma ths logikhs pra3hs (oti epsetrepse h socket()) < 0.
> An ontws einai 0 (den to epsa3a) einai to stdin, to opoio indeed den
> einai socket gia na kaneis bind. Alla kai kati allo na einai, pali
> auto ftaiei (bazontas tis paren8eseis doulepse).
>
> Geia kai xara!
>
> Costas
Kai pragmati, bazontas tis parentheseis doulepse.
Kai egw o ilithios ekoba to kefali mou oti to eixa dokimasei KAI ayto (nai,
dokimasa polla, den ksekinisa tin efarmogi etsi :-)
Kai pali eyxaristw Costa
Michalis Kabrianis
kabrianis at hellug.gr
http://homepages.pathfinder.gr/mkab
--
linux-greek-users mailing list -- http://lists.hellug.gr
More information about the Linux-greek-users
mailing list