Search:

Type: Posts; User: chenayang

Page 1 of 2 1 2

Search: Search took 0.01 seconds.

  1. Replies
    16
    Views
    13,005

    Got it, thanks, I have read this but it confuse...

    Got it, thanks, I have read this but it confuse me that:
    So it should means the *addrlen should be initialized. I thought not NULL is enough.
  2. Replies
    16
    Views
    13,005

    [QUOTE=salquestfl;965301] Thanks a lot,...

    Thanks a lot, salquestfl. I really solve it by initialize the client_name_len with a non-negative value:

    //NG//socklen_t client_name_len;
    //OK//socklen_t...
  3. Replies
    16
    Views
    13,005

    Hi Salem and brewbuck, I have tried to get the...

    Hi Salem and brewbuck, I have tried to get the return value for the socket functions:
    $ ./socket-server /tmp/sockettest
    bind(): Success
    Listen(): Success
    accept(): Invalid argument

    For client:...
  4. Replies
    16
    Views
    13,005

    Hi Salem, thank you so much to let me know how to...

    Hi Salem, thank you so much to let me know how to print error details.
    For error 22 EINVAL(invalid argument) which means:
    Socket is not listening for connections, or addrlen is invalid (e.g., is...
  5. Replies
    16
    Views
    13,005

    The following is the gdb information: First: $...

    The following is the gdb information:
    First:
    $ gdb --args ./socket-server /tmp/sockettest
    (gdb) b 20 //break at malloc()
    Breakpoint 1 at 0x804862f: file socket-server.c, line 20.
    (gdb) r...
  6. Replies
    16
    Views
    13,005

    Thanks, the environment is not available now and...

    Thanks, the environment is not available now and I have to provide more information later. I think the text = (char*) malloc (length) code should return NULL pointer if getting wrong length from...
  7. Replies
    16
    Views
    13,005

    Thanks a lot for your advice, Salem. I...

    Thanks a lot for your advice, Salem.
    I remembered that the server side should stop at strlen():
    movl (%eax), %ecx while the %eax is shown as 0(NULL pointer). So I guessed the ./server got nothing...
  8. Replies
    16
    Views
    13,005

    Why the local socket program occur core dump?

    Hi all,
    I am learning from a linux programming book and find that the following program occurs core dump on Fedora13. Could you please help to see what happened? Seems nothing is written to the...
  9. Help:how can I insert the driver files into a program using C++?

    Hi all, I have just built a driver files(drv.sys) using DDK which can access I/O ports.
    Then I build a program to run the _outpd/_inpd function via the driver under Win32.
    And now I would like to...
  10. I found some methods by changing GDT/IDT which...

    I found some methods by changing GDT/IDT which can get ring0 by assembling codes.
    But I would like to know how to use driver to load a program in ring0 privilege:
    The program contains driver and...
  11. How can a program get ring0 privilege easily?

    Hi friends, I would like to get PCI configuration address under Win32(XP or 2003).
    The sample code shows process to get offset via port cf8h and cfch. But I found the program need to get ring0...
  12. Replies
    0
    Views
    882

    Help about Link option /stub

    Hi friends, I would like to get a tool which can run under pure Dos and Win32 altogether:
    First use tc3.0 to compile the source file under pure Dos and get a_dos.exe;
    then I would like to compile...
  13. Thanks MacGyver and King. By the way are you...

    Thanks MacGyver and King. By the way are you familiar with the "Emulatation" technology which is mentioned above?
    For example, if we would like to run a win32 console application under pureDos we...
  14. But I really find some debug tools can run pure...

    But I really find some debug tools can run pure Dos and windows XP console at the same time!
    What are the key points to make such tools?
  15. Help: how to compile a console application which can run pure Dos/Win32/Win64

    Hi friends, I am a freshman and would like to compile a console tool. Can any compiler(VC++ or Intel C++ or GCC) make a "console application" which can run Freedos/Win32 consile/Win64 console...
  16. Thanks,Mats. I found the referenced notes in C++...

    Thanks,Mats.
    I found the referenced notes in C++ Primer 5th.Edition as well. "char *" is just a special condition and cout treat it as a string pointer.
  17. Got it.thanks,Mats. But where can I get this...

    Got it.thanks,Mats.
    But where can I get this info. in other files/books?
  18. Why can't get the right address for char type

    Hi friends,please help to see the following codes:


    #include <iostream>
    using namespace std;
    int main(void)
    {
    int a=4.5;
    char b='c';
    cout<<"The data "<<a<<" stores at address "<<&a<<endl;
  19. Replies
    9
    Views
    3,136

    Hi Daved and brewbuck, Thank you very much....

    Hi Daved and brewbuck,
    Thank you very much.
    Got it.

    catch(const char *str).
    But I'm still confused about when I need to add the "const".
    Could you please show me more about how to use the...
  20. Replies
    9
    Views
    3,136

    I run the program in windows console and the...

    I run the program in windows console and the "Debug error" pops up.

    If touch on "Ignore" the following is the output:
    /*output
    Start
    This is try block!

    This application has requested the...
  21. Replies
    9
    Views
    3,136

    I also tried the following code to catch the...

    I also tried the following code to catch the exception but I found the exception type is unkonwn
    and not be "char *"

    #include <iostream>
    using namespace std;
    void test(void)
    {
    try
    {...
  22. Replies
    9
    Views
    3,136

    The line throw "String"; should occur some...

    The line

    throw "String";
    should occur some errors.
    I got a debug error when running the code:
    Project XX raised exception class const char * with message 'Exception Object Address:0x8F444E' in...
  23. Replies
    9
    Views
    3,136

    Why can't throw/catch a const string

    Hi friends,
    I found the following codes and the catch
    block couldn't get the string correctly. Could you please help to see it. Thanks.

    #include <iostream>
    using namespace std;
    void test(void)...
  24. Replies
    8
    Views
    1,363

    Thanks a lot for ur help. I got similar codes on...

    Thanks a lot for ur help.
    I got similar codes on a book and it should be wrong.
  25. Replies
    8
    Views
    1,363

    Tks, got it. But why would occur compile error...

    Tks, got it.
    But why would occur compile error if adding the line

    float addin(float a,int b);
Results 1 to 25 of 28
Page 1 of 2 1 2