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.
Type: Posts; User: chenayang
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.
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...
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:...
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...
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...
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...
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...
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...
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...
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...
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...
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...
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...
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?
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...
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.
Got it.thanks,Mats.
But where can I get this info. in other files/books?
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;
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...
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...
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
{...
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...
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)...
Thanks a lot for ur help.
I got similar codes on a book and it should be wrong.
Tks, got it.
But why would occur compile error if adding the line
float addin(float a,int b);