(E-Mail Removed) (P.T. Breuer) wrote in message news:<(E-Mail Removed)>...
> Boltar <(E-Mail Removed)> wrote:
>
> > Is this required for a complete connect?
>
> Don't be silly! Anyway, you've already connected.
Well I didn't think so but you can never take anything for granted in
programming
>
>
> > No , this is on the initial connection having started up new processes. I've
> > double checked everything , can't see any fault. Maybe the option makes
> > the difference?
>
> No.
>
> Provide the simpleset example of your code possible. About 10 lines.
The client I wrote (modified an old program of mine to do SCTP) is available
here (the code is too spread out to post the relevant bits in this message):
http://www.ogham.demon.co.uk/zips/scl.c
The relevant server code is:
/* initialize sockets */
printf("Initialising sockets on port %d\n",PORT);
size=sizeof(struct sockaddr_in);
#ifdef SCTP
if ((listen_sock = socket(PF_INET,SOCK_STREAM,IPPROTO_SCTP)) == -1) {
#else
if ((listen_sock=socket(PF_INET,SOCK_STREAM,IPPROTO_T CP)) == -1) {
#endif
perror("socket()"); exit(1);
}
/* Allow reboots even with TIME_WAITS etc on port */
on=1;
setsockopt(listen_sock,SOL_SOCKET,SO_REUSEADDR,(ch ar *)&on,sizeof(on));
bind_addr.sin_family=AF_INET;
bind_addr.sin_addr.s_addr=INADDR_ANY;
bind_addr.sin_port=htons(PORT);
if (bind(listen_sock,(struct sockaddr *)&bind_addr,size) == -1) {
perror("bind()"); exit(1);
}
if (listen(listen_sock,20)==-1) {
perror("listen()"); exit(1);
}
:
:
:
accept_sock=accept(listen_sock,(struct sockaddr *)&acc_addr,&size);
printf("Connect on socket %d\n",accept_sock);
:
:
:
Hope that helps.
Thanks for your time btw.
B2003