Adobe Dreamweaver Forums



Last 10 THreads :         Repeater and XML problem (Last Post : ntsiii - Replies : 2 - Views : 4 )           »          Focus, Browsers & Spry Accordion (Last Post : CORDFrank - Replies : 5 - Views : 7 )           »          Can't upload selected pdf's to remote server (Last Post : sw2gtg - Replies : 1 - Views : 2 )           »          Disabling menu bars in a browser window (Last Post : Alan - Replies : 3 - Views : 4 )           »          Navigation from Contact Form (Last Post : sw2gtg - Replies : 3 - Views : 6 )           »          CF8 Help in Dreamweaver CS3 (Last Post : A.J.cfm - Replies : 0 - Views : 1 )           »          SWF slide show does not play (Last Post : sw2gtg - Replies : 1 - Views : 2 )           »          Javahelp/Oracle Help (Last Post : cindys@ddms.com - Replies : 9 - Views : 10 )           »          FlashVars help (Last Post : Cgull - Replies : 2 - Views : 3 )           »          Quiz results and slide views (Last Post : dlspielman@gmail.com - Replies : 0 - Views : 1 )           »         


Home Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
User Info Statistics
Go Back   Adobe Dreamweaver Forums > Other Macromedia/Adobe Products > Flex
 
Tags:



Reply
  #11 (permalink)  
Old 10-31-2008, 06:25 PM
tiaan.wessels
 
Posts: n/a
Diggs:
Default Re: Flex and C++

I'm sorry but i don't have a self-contained example and am buried under work so it might take a while to concoct up something. Which part are you referring to, the C or Flex part or both ?
Reply With Quote
Sponsored Links
  #12 (permalink)  
Old 10-31-2008, 06:30 PM
ice9_us
 
Posts: n/a
Diggs:
Default Re: Flex and C++

Sorry i just saw this or i would have posted sample code long ago..
Let me know if you need anything else..
when you accept a connection you call simple read/write functions to pass
data...
I am more than happy to help..



int main(int argc, char **argv) {

FILE *fp;
int listenfd, connfd, n, status ;
const int on = 1;
pid_t childpid;
pid_t parent;
socklen_t clilen;

struct sockaddr_in cliaddr, servaddr;

buff2=malloc(512);
host_connect=malloc(14);

listenfd = socket(AF_INET, SOCK_STREAM, 0);
bzero(&servaddr, sizeof(servaddr));
servaddr.sin_family = AF_INET;
servaddr.sin_addr.s_addr = htonl(INADDR_ANY);
servaddr.sin_port = htons(Put your port number here);

setsockopt(listenfd, SOL_SOCKET, SO_REUSEADDR, &on, sizeof(on));
setsockopt(listenfd, SOL_SOCKET, TCP_NODELAY, &on, sizeof(on));

bind(listenfd, (struct sockaddr *) &servaddr, sizeof(servaddr));
listen(listenfd, 300);


/** When testing network stuff here.. use UNIX telnet stuff.. some apps are
sending extra data...
this is the reason you see me check for the # of data waiting to be
read before i even start working...
I also have functions which check for buffer over flow attacks and other
types of hacks...
***/

if ( ( parent = fork()) == 0 ) {
for ( ; ; ) {
clilen = sizeof(cliaddr);
if ( (connfd = accept(listenfd, (struct sockaddr *) &cliaddr,
&clilen)) < 0 ) {
if ( errno == EINTR ) {
continue;
} else {
perror("accept");
}
}

Reply With Quote


  #13 (permalink)  
Old 10-31-2008, 06:30 PM
ice9_us
 
Posts: n/a
Diggs:
Default Re: Flex and C++

/** When testing network stuff here.. use UNIX telnet stuff.. some apps are
sending extra data...
this is the reason you see me check for the # of data waiting to be read
before i even start working...
I also have functions which check for buffer over flow attacks and other types
of hacks...
***/

--------------------------------------------------------------------------------
----------------------------
you don't see this take place.. i did a cut and P. of some of my basic stuff
to get ya going..
if you need any more help let me know.. I will be more than happy do do
anything i can..

I am very sorry i didn't see this post until now..

Reply With Quote
  #14 (permalink)  
Old 11-02-2008, 01:31 AM
namala
 
Posts: n/a
Diggs:
Default Re: Flex and C++

Can u give me the sample code please...........
Reply With Quote
  #15 (permalink)  
Old 11-02-2008, 01:31 AM
tiaan.wessels
 
Posts: n/a
Diggs:
Default Re: Flex and C++

I'm sorry but i don't have a self-contained example and am buried under work so it might take a while to concoct up something. Which part are you referring to, the C or Flex part or both ?
Reply With Quote


  #16 (permalink)  
Old 11-02-2008, 01:43 AM
ice9_us
 
Posts: n/a
Diggs:
Default Re: Flex and C++

Sorry i just saw this or i would have posted sample code long ago..
Let me know if you need anything else..
when you accept a connection you call simple read/write functions to pass
data...
I am more than happy to help..



int main(int argc, char **argv) {

FILE *fp;
int listenfd, connfd, n, status ;
const int on = 1;
pid_t childpid;
pid_t parent;
socklen_t clilen;

struct sockaddr_in cliaddr, servaddr;

buff2=malloc(512);
host_connect=malloc(14);

listenfd = socket(AF_INET, SOCK_STREAM, 0);
bzero(&servaddr, sizeof(servaddr));
servaddr.sin_family = AF_INET;
servaddr.sin_addr.s_addr = htonl(INADDR_ANY);
servaddr.sin_port = htons(Put your port number here);

setsockopt(listenfd, SOL_SOCKET, SO_REUSEADDR, &on, sizeof(on));
setsockopt(listenfd, SOL_SOCKET, TCP_NODELAY, &on, sizeof(on));

bind(listenfd, (struct sockaddr *) &servaddr, sizeof(servaddr));
listen(listenfd, 300);


/** When testing network stuff here.. use UNIX telnet stuff.. some apps are
sending extra data...
this is the reason you see me check for the # of data waiting to be
read before i even start working...
I also have functions which check for buffer over flow attacks and other
types of hacks...
***/

if ( ( parent = fork()) == 0 ) {
for ( ; ; ) {
clilen = sizeof(cliaddr);
if ( (connfd = accept(listenfd, (struct sockaddr *) &cliaddr,
&clilen)) < 0 ) {
if ( errno == EINTR ) {
continue;
} else {
perror("accept");
}
}

Reply With Quote
  #17 (permalink)  
Old 11-02-2008, 01:43 AM
ice9_us
 
Posts: n/a
Diggs:
Default Re: Flex and C++

/** When testing network stuff here.. use UNIX telnet stuff.. some apps are
sending extra data...
this is the reason you see me check for the # of data waiting to be read
before i even start working...
I also have functions which check for buffer over flow attacks and other types
of hacks...
***/

--------------------------------------------------------------------------------
----------------------------
you don't see this take place.. i did a cut and P. of some of my basic stuff
to get ya going..
if you need any more help let me know.. I will be more than happy do do
anything i can..

I am very sorry i didn't see this post until now..

Reply With Quote
  #18 (permalink)  
Old 11-03-2008, 04:29 AM
namala
 
Posts: n/a
Diggs:
Default Re: Flex and C++

Can u give me the sample code please...........
Reply With Quote


  #19 (permalink)  
Old 11-03-2008, 04:29 AM
tiaan.wessels
 
Posts: n/a
Diggs:
Default Re: Flex and C++

I'm sorry but i don't have a self-contained example and am buried under work so it might take a while to concoct up something. Which part are you referring to, the C or Flex part or both ?
Reply With Quote
  #20 (permalink)  
Old 11-03-2008, 04:39 AM
ice9_us
 
Posts: n/a
Diggs:
Default Re: Flex and C++

Sorry i just saw this or i would have posted sample code long ago..
Let me know if you need anything else..
when you accept a connection you call simple read/write functions to pass
data...
I am more than happy to help..



int main(int argc, char **argv) {

FILE *fp;
int listenfd, connfd, n, status ;
const int on = 1;
pid_t childpid;
pid_t parent;
socklen_t clilen;

struct sockaddr_in cliaddr, servaddr;

buff2=malloc(512);
host_connect=malloc(14);

listenfd = socket(AF_INET, SOCK_STREAM, 0);
bzero(&servaddr, sizeof(servaddr));
servaddr.sin_family = AF_INET;
servaddr.sin_addr.s_addr = htonl(INADDR_ANY);
servaddr.sin_port = htons(Put your port number here);

setsockopt(listenfd, SOL_SOCKET, SO_REUSEADDR, &on, sizeof(on));
setsockopt(listenfd, SOL_SOCKET, TCP_NODELAY, &on, sizeof(on));

bind(listenfd, (struct sockaddr *) &servaddr, sizeof(servaddr));
listen(listenfd, 300);


/** When testing network stuff here.. use UNIX telnet stuff.. some apps are
sending extra data...
this is the reason you see me check for the # of data waiting to be
read before i even start working...
I also have functions which check for buffer over flow attacks and other
types of hacks...
***/

if ( ( parent = fork()) == 0 ) {
for ( ; ; ) {
clilen = sizeof(cliaddr);
if ( (connfd = accept(listenfd, (struct sockaddr *) &cliaddr,
&clilen)) < 0 ) {
if ( errno == EINTR ) {
continue;
} else {
perror("accept");
}
}

Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



© Camley Interactive (camley.info) 2008 - all logos and images are copywrite their respective owners.
Proud member of the Camley Interactive Network
All times are GMT. The time now is 05:56 PM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0 ©2007, Crawlability, Inc.
Cheap Car Insurance - Compare Motor Insurance
Endsleigh Car Insurance Natwest Car Insurance
More Than Car Insurance Norwich Union Car Insurance
Prudential Car Insurance Zurich Car Insurance
Inactive Reminders By Mished.co.uk