Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 150750 Details for
Bug 233608
Native SCTP - traffic randomly stops on RedHat AS4 Update 4
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
catcher source code
catcher.c (text/plain), 2.34 KB, created by
William Reich
on 2007-03-23 13:11:41 UTC
(
hide
)
Description:
catcher source code
Filename:
MIME Type:
Creator:
William Reich
Created:
2007-03-23 13:11:41 UTC
Size:
2.34 KB
patch
obsolete
>/****************************************************************************** > Copyright (c) 2005 Ulticom, Inc. > >File: catcher.c >Author: Anatoly Khusid >Created: 10/21/05 >Description: >*******************************************************************************/ > >#include <sys/types.h> >#include <sys/socket.h> >#include <netinet/in.h> >#include<stdio.h> >#include<string.h> >#include<stdlib.h> >#include<netinet/sctp.h> > > >int >main(int argc, char **argv) >{ > struct sockaddr_in in4; > struct sockaddr *sockaddr; > socklen_t socklen; > int fd; > int port = 0; > char buf[256]; > struct sctp_sndrcvinfo sinfo; > int msg_flags = 0; > int on = 1; > > > int i; > int new_fd; > int id = 0; > > port = 10000; > > for ( i = 0; i < argc; i++ ) > { > if ( !strcmp(argv[i], "-port") && i+1 < argc ) > { > port = atoi(argv[++i]); > } > } > printf("using port = %d\n", port ); > > if ( (fd = socket(PF_INET, SOCK_STREAM, IPPROTO_SCTP)) == -1) > { > perror("socket() failed"); exit(1); > } > > memset(&in4, 0, sizeof(in4)); > in4.sin_family = AF_INET; > in4.sin_port = htons(port); > in4.sin_addr.s_addr = inet_addr("172.25.5.228"); > sockaddr = (struct sockaddr *) &in4; > socklen = sizeof(in4); > > > if(setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, > &on, sizeof(on))) > { > perror("setsockopt() failed"); > } > > if ( bind(fd, sockaddr, socklen) == -1) > { > perror("bind()");exit(1); > } > > if ( listen(fd, 10) == -1 ) > { > perror("listen()");exit(1); > } > > printf("waiting for client to connect\n"); > > > while(1) > { > socklen = sizeof(in4); > int client = 0; > if ( (new_fd = accept(fd, sockaddr, &socklen)) == -1) > { > perror("accept()");exit(1); > } > id++; > switch(fork()) > { > case -1: > perror("fork failed"); > break; > > case 0: /* child */ > close(fd); > client = 1; > break; > > default: /* parent */ > /* go back and listen for more pitchers */ > close(new_fd); > } > if(client == 1) > { > break; > } > > } > > printf("catcher starts reading messages, id=%d\n", id); > i = 0; > while(1) > { > socklen = sizeof(in4); > if(sctp_recvmsg(new_fd, (void *)buf, sizeof(buf), sockaddr, > &socklen, &sinfo, &msg_flags) <= 0) > { > perror("sctp_recvmsg()");exit(1); > } > if ( (i++ % 10000) == 0 ) > { > printf("id = %d, msg read=%d\n", id, i); > fflush(stdout); > } > } > > >}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 233608
:
150748
|
150749
| 150750 |
150751
|
150752
|
150753
|
150754
|
158214
|
159542