CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com

Search:

Type: Posts; User: zio_mangrovia

Page 1 of 7 1 2 3 4

Search: Search took 0.02 seconds.

  1. Replies
    5
    Views
    5,336

    Re: network down with socket effects

    In std C89 can you suggest me where to sei KeepAlive ?
    In what primitive? Socket ? send ? recv ? And about timing value ?
  2. Replies
    3
    Views
    12,669

    Re: structure sockaddr

    I'm referencing to this one sockaddr_in

    Why it has been implemented a structure to contain af_family, port and ip address ?
  3. Replies
    5
    Views
    5,336

    Re: network down with socket effects

    Ok thank you.
    I thought this behaviour of KeepAlive could to be useful only to prevent some application states before send/recv was used. what do you think ?
  4. Replies
    3
    Views
    12,669

    structure sockaddr

    What is reason to put data (ip, port) into structure of sockaddr to use connect primitive or bind ?
    It could to be easier to pass as single parameters (ip or ports) instead to pass the structure ?...
  5. Replies
    5
    Views
    5,336

    network down with socket effects

    I'm writing network app client/server with tcp persistent connection. If network went down, both client and server socket are kept opened, they are not closed automatically. So how can I prevent this...
  6. Replies
    5
    Views
    4,037

    fflush(stdout)

    If I want to write code for C89 It's necessary to use fflush(stdout) during message print to output ?
    E.g. with printf("message") .
  7. Replies
    1
    Views
    6,592

    htonl function

    Lets' suppose to convert int type from host byte order to network byte order to send data to another host and I want to use htonl function.
    Host byte order depends on computer architecture...
  8. Replies
    0
    Views
    8,106

    close socket in client and server

    On the same machine I created client and server application where client always starts communication and open socket to server on port 2001.
    Netstat shows:

    1) tcp 0 0 0.0.0.0:2001 ...
  9. Replies
    1
    Views
    1,147

    exit and data structure to deallocate

    In code when you use exit() instruction to close process, It's good practise close sockets or files and deallocate data structure before invoke exit(). I thought when process is auto-destroyed this...
  10. Re: return value of recv when process is killed

    I noted select return 1 when remote process is receiving ctrl-c while I thought it received -1 value.
    I create server process where stdin and communication sockets are inserted into fd_set to...
  11. return value of recv when process is killed

    In network where process C is client and another one S is server,
    C is waiting network message or user input by select function, idem S.

    If I kill process A, RECV of server S receives -1 value...
  12. Replies
    13
    Views
    5,929

    Re: right management of recv function in C

    It's very interesting what you are saying: for some reason, it calls send() several times
    so It's possible for few byte for some reason bytes can to be sent/recevived in multiple call so It's...
  13. Replies
    13
    Views
    5,929

    Re: right management of recv function in C

    But this behaviour depends of how application Is made, according to your example programmer decides how to send data:
    programmer can decide to send "AB"or "ABC" on 1st SEND , so RECV will ...
  14. Replies
    13
    Views
    5,929

    Re: right management of recv function in C

    if you run man recv in return value section says:

    On success, a file descriptor for the new socket is returned. On error, -1 is returned, and errno is set to indicate the error
  15. Replies
    13
    Views
    5,929

    Re: right management of recv function in C

    My environment is Ubuntu OS and compiler is gcc
  16. Replies
    13
    Views
    5,929

    Re: right management of recv function in C

    Let's suppose programmer doesn't know buffer size and It's need to send 8192 Bytes, how programmer should have to set cycle to send data by TCP socket ? I think by multiple blocks of data sending......
  17. Replies
    13
    Views
    5,929

    Re: right management of recv function in C

    TCP

    How you suggested, It likes there is limit to send bytes in a single task ? What is maximum size of buffer to receive / send data at one time ?
  18. Replies
    13
    Views
    5,929

    right management of recv function in C

    I'd like to know if return code test of recv function in my C application, according to std c89, is right.


    While (1) {
    ...
    ret = recv(socket, buffer, lun, 0);

    if ( ret == -1 ||...
  19. Replies
    3
    Views
    3,654

    Re: header file

    If I had these 2 module :
    utility.c + utility.h (linked list functions)
    server.c + server.h

    every .header file contains declaration of functions plus data structure because I want to isolate...
  20. Replies
    9
    Views
    3,336

    Re: strtok doubts

    thanks to all.
    I need to understand and your confirm helped me.
  21. Replies
    9
    Views
    3,336

    Re: strtok doubts

    I thank you very much for your code but my target is understand C code which I indicated, even if this doesn't work.
    Please help to understand the following lines and afterwards I'll be able to...
  22. Replies
    9
    Views
    3,336

    Re: strtok doubts

    I know infact I copied string into another one as job string. Same thing for every line (which is tokenized) is copied to another one for extracting words.
  23. Replies
    9
    Views
    3,336

    Re: strtok doubts

    It's true only if you use 2nd strtok with NULL as 1st parameter that is strtok(NULL,delimiter); I know strtok has no state.
    In my case strtok is run as It was always the first time with...
  24. Replies
    9
    Views
    3,336

    strtok doubts

    I read several documents about strtok according to C89/90, that is my target.
    I want to use only strtok and I need to divide string into lines by '#' delimiter and line into words by ';' delimiter....
  25. Replies
    3
    Views
    3,654

    header file

    I have 4 module.c (a,b,c,d,) and 2 ( a, b) of them share a data structure so I think to declare the data structure into a header file which will be referenced both into a and into b module.
    It's...
Results 1 to 25 of 158
Page 1 of 7 1 2 3 4





Click Here to Expand Forum to Full Width

Featured