Sponsored Content
Full Discussion: udp socket programming
Top Forums UNIX for Dummies Questions & Answers udp socket programming Post 302255773 by unsweety on Friday 7th of November 2008 05:05:22 AM
Old 11-07-2008
Quote:
Originally Posted by Yogesh Sawant
smells like homework to me
No, its not homework... I have a code but its not working fine...
 

10 More Discussions You Might Find Interesting

1. Programming

Socket Programming socket

Hello, I actually try to make client-server program. I'm using SCO OpenServer Release 5.0.0 and when I try to compile my code (by TELNET) I've got this error : I'm just using this simple code : and I get the same error if I use : If someone can help me, Thanks (2 Replies)
Discussion started by: soshell
2 Replies

2. Shell Programming and Scripting

Socket programming in bash (using /dev/udp)

Hi, I am trying to write 2 simple scripts. One to echo a message into a socket, and the other to read from it. There are many tutorials about, but they're mostly about retrieving web pages through a socket. The code I'm trying is echo qwerty > /dev/udp/localhost/22 (the first port I found that... (2 Replies)
Discussion started by: zeppelin147
2 Replies

3. Programming

UDP socket - can both client and server recv and send

Hi, Am very new to socket programming. When we use UDP sockets to communicate between two processess, will both the client/server socket be able to send/recv ? meaning can sendto()/ recvfrom() be used on both server and client? It could be useful even if anybody provide some link on socket... (1 Reply)
Discussion started by: rvan
1 Replies

4. Programming

socket programming (UDP with multiple clients)

Hi all, I have an application where there are 5 udp clients/senders which keep sending data to same IP with different port number can I design my udp server to recieve data from all 5 clients at the same time? how should I use the server address structure? should I use different... (3 Replies)
Discussion started by: shashi
3 Replies

5. UNIX for Dummies Questions & Answers

socket programming using udp for chat application

hi, i have a source code for 1 server and 2 clients ...but the clients are not able to send data..1 server only receives data from clients and forwards to any other client, the data is in the buffer.....please help... thank you in advance..... /**********client1***************/ // Here Data... (1 Reply)
Discussion started by: unsweety
1 Replies

6. IP Networking

UDP server socket inaddr_any - How to get the real IP

Hello ! I seem to have the same problem as in https://www.unix.com/ip-networking/91203-inaddr_any-opposite.html#post302262417 But I can't find a solution. I have a UDP server socket bound to 0.0.0.0. The server hosts the addresses IP1, IP2 and IP3. I get an incoming request to IP1. I use... (1 Reply)
Discussion started by: steinwej
1 Replies

7. Programming

reliable udp and socket programming

could somebody give me hand programming the attached request. my code isn't complete and i do not really understand how should i implement that. (1 Reply)
Discussion started by: makaveli_
1 Replies

8. Programming

help me about sending file through socket udp with c in linux

hi, i am newbie of socket. i want to ask some question. if i want to send file from client to server, how do i do? and if i want to send file from server to client, how do i do? any pro help me and if possible, you can post code for an example i need it very much thank you for helping me:)... (1 Reply)
Discussion started by: tung1984
1 Replies

9. Programming

socket programming using UDP connection

I want to send packets through single socket() but using two different port numbers in UDP. Anybody give some idea on this. Thanks in advance.:) (2 Replies)
Discussion started by: naresh046
2 Replies

10. UNIX for Advanced & Expert Users

UDP Socket File Sharing

Hai, I am having one server/client both running in different host in UDP. How can i assure whether the data is recieved properly in client side. I am writing 250 KB in Server and client reading only 150 KB data. I am using select write in server and select read in client also.If i am putting one... (1 Reply)
Discussion started by: andrew.paul
1 Replies
UDP(4)							   BSD Kernel Interfaces Manual 						    UDP(4)

NAME
udp -- Internet User Datagram Protocol SYNOPSIS
#include <sys/socket.h> #include <netinet/in.h> int socket(AF_INET, SOCK_DGRAM, 0); int socket(AF_INET6, SOCK_DGRAM, 0); DESCRIPTION
UDP is a simple, unreliable datagram protocol which is used to support the SOCK_DGRAM abstraction for the Internet protocol family. UDP sockets are connectionless, and are normally used with the sendto(2) and recvfrom(2) calls, though the connect(2) call may also be used to fix the destination for future packets (in which case the recv(2) or read(2) and send(2) or write(2) system calls may be used). UDP address formats are identical to those used by TCP. In particular UDP provides a port identifier in addition to the normal Internet address format. Note that the UDP port space is separate from the TCP port space (i.e. a UDP port may not be ``connected'' to a TCP port). In addition broadcast packets may be sent (assuming the underlying network supports this) by using a reserved ``broadcast address''; this address is network interface dependent. There are two UDP-level setsockopt(2)/getsockopt(2) options. UDP_OPTIONS may be used to change the default behavior of the socket. For example: setsockopt(s, IPPROTO_UDP, UDP_OPTIONS, NULL, 0); The UDP_ENCAP option can be used to encapsulate ESP packets in UDP. There are two valid enapsulation options: UDP_ENCAP_ESPINUDP_NON_IKE from draft-ietf-ipsec-nat-t-ike-00/01 and UDP_ENCAP_ESPINUDP from draft-ietf-ipsec-udp-encaps-06 defined in <netinet/udp.h>. The UDP_RFC6056ALGO can be used to randomize the port selection. Valid algorithms are described in rfc6056(7) and their respective constants are in <netinet/rfc6056.h>. For example, int algo = RFC6056_ALGO_RANDOM_PICK; /* see <netinet/rfc6056.h> */ setsockopt(s, IPPROTO_UDP, UDP_RFC6056ALGO, &algo, sizeof(algo)); The port selection can be also controlled at a global level for all UDP or UDP6 sockets using the following sysctl(7) variables: net.inet.udp.rfc6056.selected and net.inet6.udp6.rfc6056.selected respectively. Options at the IP transport level may be used with UDP; see ip(4) or ip6(4). DIAGNOSTICS
A socket operation may fail with one of the following errors returned: [EISCONN] when trying to establish a connection on a socket which already has one, or when trying to send a datagram with the destina- tion address specified and the socket is already connected; [ENOTCONN] when trying to send a datagram, but no destination address is specified, and the socket hasn't been connected; [ENOBUFS] when the system runs out of memory for an internal data structure; [EADDRINUSE] when an attempt is made to create a socket with a port which has already been allocated; [EADDRNOTAVAIL] when an attempt is made to create a socket with a network address for which no network interface exists. SEE ALSO
getsockopt(2), recv(2), send(2), socket(2), inet(4), inet6(4), intro(4), ip(4), ip6(4), rfc6056(7), sysctl(7) User Datagram Protocol, RFC, 768, August 28, 1980. Requirements for Internet Hosts -- Communication Layers, RFC, 1122, October 1989. HISTORY
The udp protocol appeared in 4.2BSD. BSD
September 24, 2011 BSD
All times are GMT -4. The time now is 08:32 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy