A Google search for "socket program" will reveal many samples including
this one[
^]. But note that IPv4 is not a protocol, merely a standard format for IP addresses. Socket programming is not dependent on IPv4 or IPv6, the same basic rules apply in either case.