Visit Our UNIX and Linux User Community

Search Results

Search: Posts Made By: sehang
Forum: Programming 05-10-2011
1,225
Posted By sehang
Client accidently close when the server crash
The steps to test the problem
1. Open TCP Server
2. Open TCP Client
3. TCP Client sends data to Server.
4. Close TCP Server and the client also crash without any notification

Second wonderful...
Forum: Programming 05-09-2011
3,348
Posted By sehang
1. There are a lot of client connections,...
1. There are a lot of client connections, normally, 70-80ms may have a new client connection comes.

$ ulimit -aS
time(seconds) unlimited
file(blocks) unlimited
data(kb) ...
Forum: Programming 05-08-2011
3,348
Posted By sehang
Finally, I found the problem, it is caused by use...
Finally, I found the problem, it is caused by use of select().
And the error message is "too many open file descriptors"; Besides, I used "netstat -an" to check the network status, I saw a lot of...
Forum: Programming 05-06-2011
3,348
Posted By sehang
Yes, I may looking at a wrong place... I will try...
Yes, I may looking at a wrong place... I will try it again now.

But signal = SIGABRT (6), how can I mask this signal within a thread?
Forum: Programming 05-05-2011
3,348
Posted By sehang
So that means using -O3 in multi-threading is a...
So that means using -O3 in multi-threading is a bad idea?
Forum: Programming 05-05-2011
3,348
Posted By sehang
Thanks, I will use fprintf to catch the pointer...
Thanks, I will use fprintf to catch the pointer value.

Before I post the problem on the forum, I tried to use

void *value=(void *)42;
int ivalue=(int)(value);

But the problem still...
Forum: Programming 05-05-2011
3,348
Posted By sehang
Thanks. I try it now. However, I can run the...
Thanks. I try it now. However, I can run the program under the text mode only since our system doesn't have a GUI. Is valgrind able to work in text mode?
Forum: Programming 05-05-2011
3,348
Posted By sehang
Thread parameter in ANSI C makes a segmentation fault
The creation of thread.

void Client_Constructor ( const char* IPAddr ) {
pthread_t tid;
pthread_attr_t rx;

/* Create separate memory for client argument */
struct...
Forum: Programming 04-29-2011
1,549
Posted By sehang
Hi, when I write the pthread_create() and...
Hi, when I write the pthread_create() and pthread_join in this way, then the program is OK.


pthread_create( ... ) <- Thread A
pthread_create( ... ) <- Thread B

pthread_join( ... ) <- Thread...
Forum: Programming 04-29-2011
1,549
Posted By sehang
unable to use a function to crate a joinable thread
In my program, threads may be created when some events trigger. So I can't create threads on initialization.

Theremore,I write a createThread() function to create thread. However, it is blocking...
Forum: Programming 03-22-2011
2,086
Posted By sehang
Hi, I hope the TCP server never stop or exit...
Hi, I hope the TCP server never stop or exit anytime. In the original one, the TCP server exits once any read error occur, it is horrible since clients may hung up during the transmission and it is...
Forum: Programming 03-21-2011
2,086
Posted By sehang
I am a little bit confused in a socket example through select()
Hi, I am a newbie about network programming. All codes come from this book: UNIX Network Programming Volume 1, Third Edition.

It is a TCP server by use select()

int main(int argc, char...
Forum: Programming 03-12-2011
1,615
Posted By sehang
Would you please give me some idea about single client and multiple servers
Hi,

I have a program which needs to connect multiple servers at the same time. The program has to collect data from each of servers and then make a decision regarding to the data received.
...
Forum: Programming 03-06-2011
2,971
Posted By sehang
How to use sigmask in order to make signals can be processed by a thread
Hi,

I have a UDP server and client program, and they must run within a program, so I decided two threads, one for UDP server and another for UDP client.

The simple architecture is shown in...
Forum: Programming 01-16-2011
16,362
Posted By sehang
SO_SNDTIMEO in setsockopt() doesn't work in send()
I create a program that need a timeout on both send() and recv() function, but I found that SO_SNDTIMEO doesn't work but SO_RCVTIMEO works!!


int sock;
int bytesRcvd,...
Forum: Programming 12-20-2010
4,062
Posted By sehang
If the problem does not related with the...
If the problem does not related with the listen(), it may be an interesting thing.

I sent 1024 packets to the server (a PC has both sender and receiver, that means, it send packets to itself)....
Forum: Programming 12-20-2010
4,062
Posted By sehang
I have upload the source code I run it on Ubuntu!
I have upload the source code I run it on Ubuntu!
Forum: Programming 12-20-2010
4,062
Posted By sehang
Handle int listen(int sockfd, int backlog) in TCP
Hi,

from the manual
listen(2): listen for connections on socket - Linux man page (http://linux.die.net/man/2/listen)

It has a parameter called backlog and it limits the maximum length of...
Forum: Programming 12-19-2010
2,764
Posted By sehang
Thanks, I will try it today.
Thanks, I will try it today.
Forum: Programming 12-14-2010
2,764
Posted By sehang
Unable to create a UDP client from thread?
I try to initial a UDP client from threading, but it doesn't work? why?


These codes from the textbook

#define ECHOMAX 255 /* Longest string to echo */
#define TIMEOUT_SECS 2 ...
Forum: Programming 11-05-2010
1,934
Posted By sehang
Hi, I am using TCP socket now, I don't understand...
Hi, I am using TCP socket now, I don't understand what is 'a late resend for end of file is received'? Would you please describe it in detail?
Forum: Programming 11-05-2010
1,934
Posted By sehang
Is this case is normal when programming in socket?
My program has two threads, one is for sender and another one is receiver,



The receiver loop forever and accept and receive data from sender.
The sender may send message if necessary...
Forum: Programming 11-02-2010
9,921
Posted By sehang
I am using Lamport's bakery algorithm to control...
I am using Lamport's bakery algorithm to control all threads since I need no starvation.

---------- Post updated at 10:13 AM ---------- Previous update was at 10:00 AM ----------



Hi,
I...
Forum: Programming 11-01-2010
9,921
Posted By sehang
The real problem like this, My program has...
The real problem like this,
My program has about 10-15 threads, they do not run at the same time, depending on what service is triggered, and then each thread may maintain 5-6 shared variables;...
Forum: Programming 11-01-2010
9,921
Posted By sehang
If I have many shared variables (more than 100),...
If I have many shared variables (more than 100), what is the better solution?
Showing results 1 to 25 of 31

 

Featured Tech Videos

All times are GMT -4. The time now is 03:00 AM.
Unix & Linux Forums Content Copyright 1993-2020. All Rights Reserved.
Privacy Policy