Logo

Hawk Software

Programming, web design, and more

Recent Posts

Category

Archives

Meta

Ask Phil – Tweaking the TCP time-out

Network, Programming No Comments

Kama asked:

I have a question related to the tweaking of TCP timeouts and retries. Basically I have an application that connects to a remote server to perform various operations. If the server dies however, it will perform operations on a local database then sync up with the server later. In linux, if the remote server is offline, the application tries to reach the server for approximately 2 minutes before it gives up and uses the local database. This of course makes the application seem like it has hung.

I’ve done some research into tweaking tcp settings. I’ve found various settings that I can tweak in the proc systems using sysctl. I’m not sure which ones will work for this task. I’m currently playing with:

tcp_orphan_retries
tcp_retries1
tcp_retries2

Does anyone know if I’m on the right track? Also I know these flags alter the settings based on the retransmission timeout (RTO). Is there anyway of tweaking the RTO? Or will tweaking one of the above flags suffice?

My reply: Read the rest of this entry »

Why I use the GPL/LGPL, but don’t buy into the full GNU philosophy

Programming No Comments

I use the GPL/LGPL (GPL for short) for current projects, and new projects will use the GPL Version 3.  But, I am no big fan of Richard Stallman, so why use the GPL at all, when there are so many other free and open source licenses?  Why do I use a free license at all?  I will answer this second question first since it has a lot to do about how I came to be a programmer. Read the rest of this entry »

Happy 8/9/10 11:12

Uncategorized 1 Comment

I scheduled this quick post just for fun.

Phil Frisbie, Jr.

Ask Phil – Losing UDP packets

Network, Programming 2 Comments

Maxime once asked:

My C program needs to send UDP packets in burst. I have the following code:

send_data()
{
err = sendto(sock, &msg1, len1, &add, lenadd);
err = sendto(sock, &msg2, len2, &add, lenadd);
err = sendto(sock, &msg3, len3, &add, lenadd);
err = sendto(sock, &msg4, len4, &add, lenadd);
err = sendto(sock, &msg5, len5, &add, lenadd);
}

I do not get any error.

When I look on the network with a sniffer, sometimes, I [see] packets. but the missing packets are never put on the network.

How can I lose packets if I have a private network with only two nodes?

I use setsockopt(sock,SOL_SOCKET, SO_SNDBUF, &maxsize, sizeof(int)); function to be sure I have enough buffer memory, but that not seams to help.

I have the same result with Windows or Linux.

Does someone have an idea? Read the rest of this entry »

Be careful when using dynamic menus

Accessibility, Web Design 2 Comments

The #1 reason I browse the Internet is to look for information and news.  The #2 reason is to look at all the cool things web designers come up with.  Cool layouts, color schemes, navigation, etc.  However, all the while in the back of my mind I always wonder about accessibility: are these cool pages still accessible to those using alternative browsers or screen readers?  The sad thing is many times the answer is ‘no’, but they could have been.  Menus (and links in general) are the worst offenders, and usually JavaScript or Flash is an accomplice. Read the rest of this entry »