From: captainpork AT fastmail DOT fm (Captain Pork) Newsgroups: comp.os.msdos.djgpp Subject: Libnet serial port problem Date: 13 Jan 2003 21:22:15 -0800 Organization: http://groups.google.com/ Lines: 50 Message-ID: NNTP-Posting-Host: 129.127.41.27 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: posting.google.com 1042521735 24429 127.0.0.1 (14 Jan 2003 05:22:15 GMT) X-Complaints-To: groups-abuse AT google DOT com NNTP-Posting-Date: 14 Jan 2003 05:22:15 GMT To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com I'm having some trouble with some serial port code I'm writing with Libnet under djgpp. Everything's fine if I only use one serial port, but if I try to receive from both serial ports at once, information can only get through from one of them at a time. Each serial port works fine by itself. What I'm trying to do is this: Each cycle, the server (each of whose serial ports are connected to one of the clients) goes through the clients and queries the channel assigned to each. If there's information coming in, all of it is read, then another check is made to make sure no further information has just arrived before the next client is queried. The clients, who are not connected to each other, just send and receive information to and from the server. What happens is this: Both clients' data come in through the same channel - apparently whichever is accessed first. Only one is actually received, though. The other client's buffer-full of data (usually around 30 bytes long) just vanishes. Usually it seems to be the first client whose buffer is accepted, but every few cycles it's the other client. The server has no problem sending through each channel, and each client gets all it's supposed to. The channels' targets are 0:1 for COM1 and 1:1 for COM2. The server's COM1 is linked to client 1's COM1, likewise COM2 goes to client 2's COM2. Targets are set on both the server and the clients. These are the only targets I can get to work (0:0, 1:0, 1, 0, :1, :0 don't work). Is the fact that they're both :1 causing the problem? I can't think of any way around this as I've tried all other addresses I can think of. So, my questions are: is this a hardware limitation? Is it a limitation in Libnet's serial driver, or in Libnet generally? Am I doing something wrong? Is there a workaround? Will this problem also apply to Libnet's IPX or IP drivers? (I don't have access to a LAN or to the 'net from my development computer, so I can't test these) This is quite a specific question, so I'm not sure anyone will be able to shed light on it. But any help would be much appreciated. I'm running djgpp in a DOS window under Win95, and my program (a game similar to Molez/Liero, BTW, which is complete other than this problem and awaits release) also links to allegro and has a couple of small timer interrupts. I'm new to Libnet and not very good at C, if that helps to explain any of the above. Thanks in advance, Captain Pork