Hi strider u made few small mistakes in ur program that I'm listing down:
1) U need not convert INADDR_ANY to network long
2) In client side u may use inet_aton() to convert client IP address (that u have taken as 127.0.0.1) to in_addr struct
Apart from above I would also like to suggest u two more things that might b helpful
1) In ur server side prog u have used server structure (sockaddr_in server) to store server address as well as the address of connecting clients in 2nd last arg of recvfrom()
2) U can avoid warnings if u type cast pointer to sockaddr_in structure to sockaddr* in bind,sendto and recvfrom.
Now I enlist the rectified code
Tell me if this worked for u or not esp. because i've tested it on Linux.
hi all, newbie here, i'm working on mac os x and i'm trying to stream some info using udp from the terminal to another app that listens for osc messages on the same machine. but the man page on udp is pretty cryptic. my question is whether anyone has a recommendation for a good tutorial covering... (0 Replies)
Just like concurrent tcp server, anyone know how to design the concurrent udp server with the thread? it's best to give some basic examples,thanks (0 Replies)
Hi there,
Does anyone know of a place that will give details for each of the following UDP parms? I've found documentation on there size limits but not what they will do or affect if changed.
udp_xmit_hiwat
udp_xmit_lowat
udp_recv_hiwat
udp_max_buf ... (1 Reply)
Dear guys,
I am facing the most weird problem I have ever encountered!
Ok here is the situation:
From my dns query.log file - it is generated using usual bind9 logging:
logging {
channel query.log {
file "/var/log/bind9/query.log" versions 10 size 2m;
severity debug 2;... (0 Replies)
Hi,
I can see "udpInOverflows" errors when I execute 'netstat -s' on my Solaris box.
The number of errors are small - about 40.
e.g.
$ netstat -s|grep udp
UDP udpInDatagrams =1249190732 udpInErrors = 0
udpOutDatagrams =31663030 udpOutErrors = 0... (1 Reply)
Hello,
I would like to ask you for a help. I need to program in C print server which is based on connectionless protocol UDP. The problem is that I am not experienced in programming network applications, I can help myself with some other answered questions on this forum about network apps in C,... (1 Reply)
Hi,
I know tcp port tunneling can be done using ssh/putty. how about udp?
I have a scenario where a license server handsout licenses to machines in that network ONLY. I have a windows machine in a different subnet and even though the client software can see license server, while using the... (6 Replies)
Performing UDP tunneling through an SSH connection
Found this while looking for a way to temporarily forward SNMP requests across otherwise disconnected networks. Might be useful for someone else, too. (1 Reply)
hi guys
My linux server have SNMP configure port by default is 161 (UDP)
now my monitor team - who are using Nagios - say the server are not being monitor
so check netstat -lnu and I see all is OK and snmp service is running fine
what else should I check about this port 161? to see if it is... (0 Replies)
Discussion started by: karlochacon
0 Replies
LEARN ABOUT MOJAVE
in
in.h(3HEAD) Headers in.h(3HEAD)NAME
in.h, in - Internet Protocol family
SYNOPSIS
#include <netinet/in.h>
DESCRIPTION
The <netinet/in.h> header defines the following types through typedef:
in_port_t An unsigned integral type of exactly 16 bits.
in_addr_t An unsigned integral type of exactly 32 bits. The <netinet/in.h> header defines the in_addr structure that includes the
following member:
The <netinet/in.h> header defines the in_addr structure that includes the following member:
in_addr_t s_addr
The <netinet/in.h> header defines the type sa_family_t as described in socket.h(3HEAD).
The <netinet/in.h> header defines the following macros for use as values of the level argument of getsockopt() and setsockopt():
IPPROTO_IP Dummy for IP
IPPROTO_ICMP Control message protocol
IPPROTO_TCP TCP
IPPROTO_UDP User datagram protocol The <netinet/in.h> header defines the following macros for use as destination addresses for
connect(), sendmsg(), and sendto():
INADDR_ANY Local host address
INADDR_BROADCAST Broadcast address
The <netinet/in.h> header defines the sockaddr_in structure that is used to store addresses for the Internet protocol family. Values of
this type must be cast to struct sockaddr for use with the socket interfaces.
Default
For applications that do not require standard-conforming behavior (those that use the socket interfaces described in section(3SOCKET) of
the reference manual; see Intro(3) and standards(5)), the <netinet/in.h> header defines the sockaddr_in structure that includes the follow-
ing members:
sa_family_t sin_family
in_port_t sin_port
struct in_addr sin_addr
char sin_zero[8]
Standard conforming
For applications that require standard-conforming behavior (those that use the socket interfaces described in section(3XNET) of the refer-
ence manual; see Intro(3) and standards(5)), the <netinet/in.h> header defines the sockaddr_in structure that includes the following mem-
bers:
sa_family_t sin_family
in_port_t sin_port
struct in_addr sin_addr
unsigned char sin_zero[8]
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|Interface Stability |Standard |
+-----------------------------+-----------------------------+
SEE ALSO Intro(3), connect(3SOCKET), connect(3XNET), getsockopt(3SOCKET), getsockopt(3XNET), sendmsg(3SOCKET), sendmsg(3XNET), sendto(3SOCKET),
sendto(3XNET), setsockopt(3SOCKET), setsockopt(3XNET), socket.h(3HEAD), attributes(5), standards(5)SunOS 5.10 30 Aug 2002 in.h(3HEAD)