Search Results

Search: Posts Made By: gautamdheeraj
Forum: Programming 04-06-2010
4,691
Posted By gautamdheeraj
Then I would say you must change the data...
Then I would say you must change the data structures to use an array of structure which should also include the connection fd and use select() to handling multiple connections. select() will tell you...
Forum: Programming 04-05-2010
4,691
Posted By gautamdheeraj
Your server is not able to handle multiple...
Your server is not able to handle multiple clients. You are doing forking and then sleeping for connection. You should be doing accept() and then fork a new child to handle a new connection. accept()...
Forum: Programming 04-01-2010
1,291
Posted By gautamdheeraj
You need to send the file size before sending...
You need to send the file size before sending actual file. Because this is binary data, you MUST NOT treat this as string data.

Also while reading/writing you should check how bytes has been...
Forum: Programming 04-01-2010
8,230
Posted By gautamdheeraj
It should be because of socket receive buffer...
It should be because of socket receive buffer limit. You can check that using set getsockopt();
You can change the buffer limit using setsockopt(). for more details "man setsockopt"
It is...
Forum: Programming 03-25-2010
23,831
Posted By gautamdheeraj
You can use sysctl() system call to get proc...
You can use sysctl() system call to get proc table and search process table. Here is code (taken from killall.c from FreeBSD)


#include <sys/param.h>
#include <sys/user.h>
#include...
Forum: Programming 03-25-2010
9,037
Posted By gautamdheeraj
Are you sure your process has been aborted (which...
Are you sure your process has been aborted (which should generate a core dump). If somewhere in the process it might be using exit() (this way it won't dump core file).

---------- Post updated at...
Forum: Web Development 03-25-2010
4,291
Posted By gautamdheeraj
I believe you need take care of <html> and <body>...
I believe you need take care of <html> and <body> tag of html files.
Forum: Programming 01-08-2010
9,501
Posted By gautamdheeraj
Always remember you must not be assigning a...
Always remember you must not be assigning a string to array. You have to copy string to a array.
Changing

buffer[255] = "MAIL FROM: test@primustel.ca";

to
strcpy(buffer, "MAIL FROM:...
Forum: Programming 10-05-2009
3,795
Posted By gautamdheeraj
you can simply use fork() and in child process...
you can simply use fork() and in child process use fwrite(command, output.txt). After fork, child and parent share open files.

Though It will be better if you post complete code and exactly what...
2,613
Posted By gautamdheeraj
This character mostly comes when you copy a file...
This character mostly comes when you copy a file from windows to unix. In this case the character comes is "^D". Just try with
dos2unix <filename>.

This should remove those special characters.
Forum: Programming 09-25-2009
4,743
Posted By gautamdheeraj
I can see some improvements in your code. *...
I can see some improvements in your code.

* In case the child process his a error, this will exiting without sending SIGALRM to parent, which will make parent to keep on printing the "#", even if...
Forum: Programming 09-17-2009
4,107
Posted By gautamdheeraj
recently I wrote an application to use SSL using...
recently I wrote an application to use SSL using self signed certificates over TCP/IP. But this was C and OpenSSL library. If this helps you, let me know.
Forum: Programming 04-06-2009
4,525
Posted By gautamdheeraj
yes, its available over the internet. search...
yes, its available over the internet. search ebookee.com for "UNIX Network Programming". You should get some link to download.
Forum: Programming 04-02-2009
4,525
Posted By gautamdheeraj
take a look at man pages. Also stevens socket...
take a look at man pages. Also stevens socket programming book is a very good reference.
Forum: Programming 03-25-2009
5,843
Posted By gautamdheeraj
You may also use other scripting language e.g....
You may also use other scripting language e.g. perl/python for your work.
Forum: Programming 03-25-2009
4,252
Posted By gautamdheeraj
try with bzeroing req_msg before following...
try with bzeroing req_msg before following statement.



- Dheeraj
Forum: Programming 03-25-2009
5,843
Posted By gautamdheeraj
Using C, you will be writing programs not...
Using C, you will be writing programs not scripts.
Anyway what help do you need? I won't mind in helping you. Go ahead and post your questions/queries? I believe this should have been posted to...
Forum: Programming 03-24-2009
4,525
Posted By gautamdheeraj
By default socket calls are blocking. To make...
By default socket calls are blocking. To make them non blocking, use setsockopt() with a receive timeout. or use ioctl with FIONBIO request.

-Dheeraj
49,116
Posted By gautamdheeraj
cat <file name> => displays the contents of the...
cat <file name> => displays the contents of the file
cat => takes input from STDIN and puts it back to the STDOUT
cat > <filename> => Take in put from STDIN and put contents in ...
Forum: Programming 05-28-2008
4,514
Posted By gautamdheeraj
Please post your code snippet of server. This way...
Please post your code snippet of server. This way we won't be able to help you much.

- Dheeraj
Forum: Programming 05-22-2008
5,783
Posted By gautamdheeraj
I believe shell script should be faster. With...
I believe shell script should be faster. With C/C++, there is a lot of copying of data to/from kernel, which makes C/C++ programs slow. To make C/C++ programs faster, you may use multithreading also....
Forum: Programming 05-21-2008
3,272
Posted By gautamdheeraj
I guess there is no way to do this using socket...
I guess there is no way to do this using socket options. I think you would have use raw sockets for that case.

- Dheeraj
Forum: Programming 05-21-2008
3,272
Posted By gautamdheeraj
You may go through chapter 27 of UNIX Network...
You may go through chapter 27 of UNIX Network programming. There author explains get/set of ip options with example.

You use following URL for softcopy.
Unix Network Programming, Vol. 1: The...
Forum: Programming 05-16-2008
2,765
Posted By gautamdheeraj
What sort of variation you are getting. *...
What sort of variation you are getting.
* sequence of print is changing OR
* Getting many printfs ? OR
* something else is there

- Dheeraj
Forum: Programming 05-16-2008
5,153
Posted By gautamdheeraj
This should work. You should check for read() > 0...
This should work. You should check for read() > 0 instead of !=0.

while( (rv = read(fd2[0], line, MAXLINE)) > 0)

Usually for any file, socket, pipe and any other stream read, we should always...
Showing results 1 to 25 of 36

 
All times are GMT -4. The time now is 06:35 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy