Search:

Type: Posts; User: Wisefool

Search: Search took 0.01 seconds.

  1. Replies
    5
    Views
    12,381

    if I've understood, I should do this, right? ...

    if I've understood, I should do this, right?



    while(1){
    if((child = fork()) == 0){ /* child process */
    close(s); /* close s because this socket was copied with the fork...
  2. Replies
    5
    Views
    12,381

    do I have to put a particular condition in the...

    do I have to put a particular condition in the loop or is "while(1)" just enough?

    and I just don't understand why I have to close the listening socket "s" before the accepted socket "ns". It...
  3. Replies
    5
    Views
    12,381

    I don't understand several things 1)what is...

    I don't understand several things

    1)what is the loop for? and how do you get out of this loop when you write while(1)?

    2)
    Shouldn't the child close the socket after it processes the request?...
  4. Replies
    5
    Views
    12,381

    when to close a socket

    I don't know where I have to put my close():

    my code is like this:



    #define SOCKET_ERROR -1
    #define STRGLEN 100 /* message string length */
    const int APORT = 1234; /* port number...
  5. Thread: Makefile

    by Wisefool
    Replies
    2
    Views
    1,185

    all right, it works thx

    all right, it works
    thx
  6. Thread: Makefile

    by Wisefool
    Replies
    2
    Views
    1,185

    Makefile

    I have 2 makefile
    one for my client:



    Client: Client.o # generate executable from objects
    gcc Client.o -o Client

    Client.o: Client.c
    gcc -c Client.c
  7. Thread: malloc

    by Wisefool
    Replies
    2
    Views
    849

    malloc

    if I have a function like this:



    void function(int* parameter){
    int * variable;
    variable = parameter;
    }

    do I have to make a malloc for variable?
  8. Replies
    2
    Views
    3,761

    well I know where the problem is I just don't...

    well I know where the problem is
    I just don't know what the problem is and how to solve it

    it's just the last line of my server's code:
    close(s);
    If I put a printf before it, my screens will...
  9. Replies
    1
    Views
    2,873

    problem closing a socket

    I can't close the socket of my server! It does everything as it should but this


    I have this code for my client (which works just fine):


    #include <sys/types.h> /* required include files */...
  10. Replies
    2
    Views
    3,761

    problem closing socket

    I can't close the socket of my server! It does everything as it should but this


    I have this code for my client:



    #include <sys/types.h> /* required include files */
    #include...
  11. Thread: time_t

    by Wisefool
    Replies
    9
    Views
    13,794

    time_t

    how do you do to save the calendar time in a file?
    one of the parameters in fprintf is the format of the variable I want to put in a file but what do I put?



    time_t t;
    FILE* p;
    fprintf(p,...
  12. Thread: recv/send

    by Wisefool
    Replies
    8
    Views
    13,280

    ok here's what I've done so far this is not my...

    ok here's what I've done so far
    this is not my real source code, just a program specifically designed to test exchanges between a client and a server

    server:


    main(){
    char string[STRGLEN],...
  13. Thread: recv/send

    by Wisefool
    Replies
    8
    Views
    13,280

    >>total += read; does it mean total=total+read?...

    >>total += read;
    does it mean total=total+read?

    I can send/receive strings both ways between my client and my server
    but now, I want to send the content of one (text) file from my client to my...
  14. Thread: recv/send

    by Wisefool
    Replies
    8
    Views
    13,280

    recv/send

    do recv and send automatically put a '\0'at the end of the string it sends?
    and I always use the same string as a parameter, should I clear the string before I do the recv or send?
  15. Replies
    5
    Views
    2,861

    all right, the send/receive works just fine,...

    all right, the send/receive works just fine, thanks to you

    now I'm trying to send the list of the users from the server to the client. I've set up a function which sends (or rather should send) to...
  16. Replies
    5
    Views
    2,861

    i've begun again from the very beginning and it...

    i've begun again from the very beginning
    and it still doesn't work
    I submit you my source code so you can tell me what's wrong
    here's the code for the client:



    // Main Function
    main(int...
  17. Replies
    5
    Views
    2,861

    Server Client on UNIX

    hi there
    I'm trying to set up a client server system on unix.
    i've got some troubles with my "write" and "read"
    I want to send the data from the client like this



    printf("Enter user's...
Results 1 to 17 of 17