参考にしたサイト:ソケットの解説
/* UDPクライアントプログラム
gcc -lsocket -lnsl -o inet_client inet_client.c */

#include 
#include 
#include 
#include 
#include 
#include 

#define ERROR(x) {
                  fprintf(stderr, "client - ");
                  perror(x);
                  exit(1);
                 }

int main(int argc, char **argv)
{
    int sockfd, len, result;
    struct sockaddr_in address;
     char ch[] = "test";

    /*UDP クライアント用ソケット作成*/
   sockfd = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP);
   /* UDP の場合には SOCK_DGRAM, IPPROTO_UDP を指定 */

    /*ソケットの名前を指定*/
    address.sin_family = AF_INET;
    address.sin_addr.s_addr = inet_addr("192.168.1.3");
    address.sin_port = htons(11000); /* htons で 関数htons()で、1
             6ビット値をネットワークバイトオーダに変換できます。*/
    len = sizeof(address);

    /*クライアントのソケットとサーバのソケットの接続
    受信側でない場合には bind はいらない。
    printf("Waiting for connection to the servern");
    result = bind(sockfd, (struct sockaddr *)&address, len);
    printf("Connected to the servern");
      */
     
    /*sockfdを介して読み書きができるようにする。
     UDP は sendto を使用する。*/
       
    sendto(sockfd, ch, sizeof(ch), 0,
           (struct sockaddr *)&address, sizeof(address));
          
    close(sockfd);
    exit(0);
}