public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
* [ECOS] Problems with ppp and Windows
@ 2004-04-22 15:14 Øyvind Harboe
  2004-06-15 10:30 ` [ECOS] " Kelvin Lawson
  0 siblings, 1 reply; 7+ messages in thread
From: Øyvind Harboe @ 2004-04-22 15:14 UTC (permalink / raw)
  To: ecos-discuss

[-- Attachment #1: Type: text/plain, Size: 1134 bytes --]

I've run out of food and drink. This will be my last note in my log :-)

- the problem is that accept() in the attached application does not wake
up until I kill the telnet process. I'm pretty confident that this app
is correct, because it works when I compile and runit from CygWin.
- Debugging TCP/IP is really difficult without an in depth knowledge of
TCP/IP and the freebsd stack. However, I believe that accept() should be
awoken by the invocation of soisconnected() from tcp_input.c since this
is what happens when I kill the windows telnet process. I don't know
what the significance, if any, it is that TCPOPT_CC is not received and
hence a "3 way handshake" is to be used instead. 
- As near as I can tell, Windows believes it is connected, because I
receive packets in my eCos application for the text I typed into the
telnet session before I kill the telnet process.
- I've submitted various patches lately in this regard, but nothing
earthshattering.


Attached: echo.c CygWin/Linux echo app. Same code gets stuck on accept()
w/PPP, Windows PPP server when running under eCos.

-- 

Øyvind Harboe
http://www.zylin.com



[-- Attachment #2: echo.c --]
[-- Type: text/x-c, Size: 1341 bytes --]


#include	<netdb.h>
#include	<netinet/in.h>
#include	<sys/types.h>
#include	<sys/socket.h>
#include	<stdio.h>
#include	<time.h>
#include	<signal.h>
#include	<string.h>


int main()
{
	int 	 sd, sd_current;
	struct   sockaddr_in sin;
	struct   sockaddr_in pin;
 
	/* get an internet domain socket */
	if ((sd = socket(AF_INET, SOCK_STREAM, 0)) != -1) 
	{
		/* complete the socket structure */
		memset(&sin, 0, sizeof(sin));
		sin.sin_family = AF_INET;
		sin.sin_addr.s_addr = INADDR_ANY;
		sin.sin_port = htons(23);

		/* bind the socket to the port number */
		if (bind(sd, (struct sockaddr *) &sin, sizeof(sin)) != -1) 
		{
			/* show that we are willing to listen */
			if (listen(sd, SOMAXCONN) != -1) 
			{
				/* wait for a client to talk to us */
			    socklen_t addrlen = sizeof(pin);
				if ((sd_current = accept(sd, (struct sockaddr *)  &pin, &addrlen)) != -1) 
				{
					for (;;)
					{
						/* get a message from the client */
						char dir[10];
						int len;
						len=recv(sd_current, dir, sizeof(dir), 0);
						if (len == -1) 
						{
							break;
						}
					
						/* acknowledge the message, reply w/ the file names */
						if (send(sd_current, dir, len, 0) != len) 
						{
							break;
						}
					}
		    	    /* close up both sockets */
					close(sd_current); 
				}
			}
		}
		close(sd);
	}
	return 0;
}



[-- Attachment #3: Type: text/plain, Size: 148 bytes --]

-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2004-06-17 14:04 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <1087322512.28254.ezmlm@ecos.sourceware.org>
2004-06-15 21:36 ` [ECOS] Problems with ppp and Windows Øyvind Harboe
2004-06-16  9:55   ` [ECOS] " Kelvin Lawson
2004-06-16 12:24 ` [ECOS] " Øyvind Harboe
2004-06-17  9:08   ` [ECOS] " Kelvin Lawson
2004-06-17 11:05     ` Øyvind Harboe
2004-06-17 14:04       ` Kelvin Lawson
2004-04-22 15:14 [ECOS] " Øyvind Harboe
2004-06-15 10:30 ` [ECOS] " Kelvin Lawson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).