User Profile

Collapse

Profile Sidebar

Collapse
apollo135
apollo135
Last Activity: Mar 18 '08, 04:27 PM
Joined: Sep 26 '07
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • Hi,

    thanks for your reply. the problem is not about the compiling ...
    Actually I don't get any warning or error when the programs are compiled, but the problem is when the sub-prog2 is exucuted and then I get the errors like: segmentation ...
    My question is how to handle multipe sending and receiving data using udp socket ???? Any one has an idea, it would be appreciated. Thanks

    Regards and thanks for...
    See more | Go to post

    Leave a comment:


  • how to handle multiple send and receive with udp socket

    Dear All,

    Could someone help and tell me how to handle multiple send and receive operations with udp sockets? In fact here is my problem:

    server.c is composing of serveral sub programs (the same for client.c)
    -----server.c-------
    [code=c]
    ............... .
    int main(){
    ............
    //create socket
    if (sd = socket(PF_INET, SOCK_DGRAM, ptrp->p_proto)) {
    fprintf(stderr,...
    See more | Go to post
    Last edited by sicarie; Oct 1 '07, 01:03 PM. Reason: Code tags

  • Hi,

    Thanks for your replies. I tried also to use macros: htonl and ntohl as the variables exchanged between client and server are defined in double. But it does not work ... and here is a peace of code I wrote:

    -------- client.cpp---
    ...
    typedef struct SIM_DATA_IN{
    // char svar_instg;
    double svar_integ[2];
    double svar_indl[5];
    };
    SIM_DATA_IN stus;
    ...
    stus.svar_integ[0]=htonl(var);...
    See more | Go to post

    Leave a comment:


  • -------------

    Hi Jos,

    I tried also to use macros: htonl and ntohl as the variables exchanged between client and server are defined in double. But it does not work ... and here is a peace of code I wrote:

    -------- client.cpp---
    ...
    typedef struct SIM_DATA_IN{
    // char svar_instg;
    double svar_integ[2];
    double svar_indl[5];
    };
    SIM_DATA_IN stus;
    ...
    See more | Go to post

    Leave a comment:


  • apollo135
    replied to Signed 'endian' ; Byte order conversion
    in C
    -------------

    Hi Jos,

    I tried also to use macros: htonl and ntohl as the variables exchanged between client and server are defined in double. But it does not work ... and here is a peace of code I wrote:

    -------- client.cpp---
    ...
    typedef struct SIM_DATA_IN{
    // char svar_instg;
    double svar_integ[2];
    double svar_indl[5];
    };
    SIM_DATA_IN stus;
    ...
    See more | Go to post

    Leave a comment:


  • Hi all,

    Thanks a lot for your replies, that is very kind of you ...
    This is just to answer you (I mean the second replyer) about using macro or not. If I know how to use it I wouldn't come here and post a message for a help ... ok!
    I want to use it because I need it for my work and if you know any other easiest way just tell it and your help would be appreciated ...
    Sorry! I am not the person who knows everything...
    See more | Go to post

    Leave a comment:


  • -----------------------

    Hi Jos,

    Thanks a lot for your reply. You are right that is what I read on the internet but I couldn't find details on how to write and it is the first time that I am dealing with. I would be glad if you could explain more about or send me the usefull link.

    Regards and thanks for your reply,
    Azwaw...
    See more | Go to post

    Leave a comment:


  • byte reordering macro (big/litte endian conversion between OS)

    Dear all,

    Could someone please clarify and help with byte ordering macro (big/litte endian conversion)? I found thefollowinf macron on the internet but I have a doubt to use it ...
    ============
    #if defined(BIG_END IAN) && !defined(LITTLE _ENDIAN)

    #define htons(A) (A)
    #define htonl(A) (A)
    #define ntohs(A) (A)
    #define ntohl(A) (A)

    #elif defined(LITTLE_ ENDIAN) &&...
    See more | Go to post

  • byte ordering macro (big/litte endian conversion between os)

    Dear all,

    Could someone please clarify and help with byte ordering macro (big/litte endian conversion)? I found thefollowinf macron on the internet but I have a doubt to use it ...
    ============
    #if defined(BIG_END IAN) && !defined(LITTLE _ENDIAN)

    #define htons(A) (A)
    #define htonl(A) (A)
    #define ntohs(A) (A)
    #define ntohl(A) (A)

    #elif defined(LITTLE_ ENDIAN) &&...
    See more | Go to post
No activity results to display
Show More
Working...