Message-ID: <3A6B8C5B.7030504@operamail.com> From: Sahab Yazdani Organization: PheonixSoft Interactive User-Agent: Mozilla/5.0 (Windows; U; Win98; en-US; m18) Gecko/20010107 X-Accept-Language: en MIME-Version: 1.0 Newsgroups: comp.os.msdos.djgpp Subject: Re: libsocket over the net... References: <3A69FEFF DOT 7020104 AT operamail DOT com> <3A6A28C3 DOT 502361A2 AT phekda DOT freeserve DOT co DOT uk> <3A6A6E2B DOT 7000204 AT operamail DOT com> <3A6AFFBA DOT 5DB1B739 AT phekda DOT freeserve DOT co DOT uk> Content-Type: multipart/mixed; boundary="------------050204080307080105090505" Lines: 212 Date: Sun, 21 Jan 2001 20:26:51 -0500 NNTP-Posting-Host: 149.99.114.135 X-Complaints-To: abuse AT sprint DOT ca X-Trace: newscontent-01.sprint.ca 980127063 149.99.114.135 (Sun, 21 Jan 2001 20:31:03 EST) NNTP-Posting-Date: Sun, 21 Jan 2001 20:31:03 EST To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com This is a multi-part message in MIME format. --------------050204080307080105090505 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Richard Dawe wrote: > Hello. > > > > Sahab Yazdani wrote: > [snip] > > > What did you change? Why is the data no longer garbled? Knowing this could > > help fix your other problems. I decreased the size of the MassacreHeader packet by 6 bytes by decreasing the size of the "header" value to 4 bytes instead of 10, this seems to fix it, cuz it only needs 1 pass to read the data no matter what. > > > > [snip] > What type of sockets are you creating - TCP/IP or UDP/IP? E.g. are you > > using: > > > > - socket(AF_INET, SOCK_STREAM, IPPROTO_TCP) for TCP/IP; I am using this one. > > - or socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP) for UDP/IP? > > > > (Actually, you should use PF_INET instead of AF_INET.) > > > > You should be able to send your headers in one packet, since they are > > small. > > > > >> as a side note, when I print out the error using either lsck_perror or > >> perror, i get this message "RETRIEVE1: Resource temporarily not > >> available (EAGAIN)" over and over again with a stray "RETREIVE2: " " " " > >> popping in there sometimes (only when data is being sent over the > >> network). > > > > Which version of Windows are you using? Do you have Winsock 2 installed? I am using Windows 98 with WinSock 2 installed (obviously). > > What does the libsocket demo program demo/diag.exe display? You can > > capture its output like so: > > > > redir -eo diag.exe > diag.out included as attachment > > > > I've never seen this error, but other people have reported it. Perhaps it > > only occurs with a small packet size? Strange. I would like to know why > > that happens. > > > > [snip] > > >> MassacreHeader CreateHeader( unsigned char packetType, unsigned char multiples ) { > >> MassacreHeader retType; > >> > >> strcpy(retType.header, "MASS" ); > > > > Since retType.Header is a 4 char array, this will overflow the buffer and > > overwrite retType.packetType, because "MASS" is 5 bytes - 'MASS\0'. If you > > want space for the nul terminator, make header a 5 char array. changed it... thank you. > > > > I still can't see anything wrong with the rest of your code. > > > > Bye, -- *********************************************************** * Sahab Yazdani * "Wizard's Third Rule: Passion rules * * Thornhill S.S * Reason." - Kolo's Journal * *********************************************************** * http://pheonixsoft.virtualave.net/ * *********************************************************** --------------050204080307080105090505 Content-Type: text/plain; name="diag.out" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="diag.out" perror(): Address family not supported (EAFNOSUPPORT) libsocket Diagnostic Program Copyright (C) 1997, 1998 by Indrek Mandre, 1997-2000 by Richard Dawe libsocket version 0.8.0 Host name: 'matrix' Domain name: '' Configuration directory: 'e:/djgpp/contrib/ls080' DNS servers: None found Interface Coda SOCK.VXD Address 127.0.0.1 netmask 255.0.0.0 --- Address 0.0.0.0 netmask 0.0.0.0 --- Address 192.168.1.1 netmask 255.255.255.0 gateway 192.168.1.1 --- Interface Unix->mailslot Testing Internet domain (AF_INET) sockets... + SUPPORTED: stream type socket with default (0) protocol . Unsupported: stream type socket with ICMP protocol + SUPPORTED: stream type socket with TCP protocol . Unsupported: stream type socket with UDP protocol . Unsupported: stream type socket with raw protocol + SUPPORTED: datagram type socket with default (0) protocol . Unsupported: datagram type socket with ICMP protocol . Unsupported: datagram type socket with TCP protocol + SUPPORTED: datagram type socket with UDP protocol . Unsupported: datagram type socket with raw protocol . Unsupported: raw type socket with default (0) protocol . Unsupported: raw type socket with ICMP protocol . Unsupported: raw type socket with TCP protocol . Unsupported: raw type socket with UDP protocol . Unsupported: raw type socket with raw protocol . Unsupported: sequential type socket with default (0) protocol . Unsupported: sequential type socket with ICMP protocol . Unsupported: sequential type socket with TCP protocol . Unsupported: sequential type socket with UDP protocol . Unsupported: sequential type socket with raw protocol Testing Unix domain (AF_UNIX) sockets... + SUPPORTED: stream type socket with default (0) protocol . Unsupported: stream type socket with ICMP protocol . Unsupported: stream type socket with TCP protocol . Unsupported: stream type socket with UDP protocol . Unsupported: stream type socket with raw protocol + SUPPORTED: datagram type socket with default (0) protocol . Unsupported: datagram type socket with ICMP protocol . Unsupported: datagram type socket with TCP protocol . Unsupported: datagram type socket with UDP protocol . Unsupported: datagram type socket with raw protocol . Unsupported: raw type socket with default (0) protocol . Unsupported: raw type socket with ICMP protocol . Unsupported: raw type socket with TCP protocol . Unsupported: raw type socket with UDP protocol . Unsupported: raw type socket with raw protocol . Unsupported: sequential type socket with default (0) protocol . Unsupported: sequential type socket with ICMP protocol . Unsupported: sequential type socket with TCP protocol . Unsupported: sequential type socket with UDP protocol . Unsupported: sequential type socket with raw protocol These should be meaningful error messages: strerror(): Address family not supported (EAFNOSUPPORT) --------------050204080307080105090505--