06-22-2011
Quote:
I want to send packets through single socket() but using two different port numbers in UDP. Anybody give some idea on this.
Do you mean you want to control the source and destination ports? If so, you can bind() to a local port and then either sendto() the remote port or connect() to it and and write()/send().
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
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
2. Programming
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
3. Programming
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
4. Programming
When i put the target IP as 127.0.1.1, the program is working fine, can catch blocked & open ports. But when i try to scan remotely, i get connection timed out! Can you tell me why? :(
Here is my code - Look at between where i put astriks - at the bottom:
#include<iostream>... (3 Replies)
Discussion started by: f.ben.isaac
3 Replies
5. UNIX for Dummies Questions & Answers
Hi...Please can someone send me implementation chat application using UDP(socket programming in C). Please send me as soon as possible. Thanks in advance. (2 Replies)
Discussion started by: unsweety
2 Replies
6. UNIX for Dummies Questions & Answers
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
7. IP Networking
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
8. 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
9. Programming
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
10. UNIX for Advanced & Expert Users
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
LEARN ABOUT FREEBSD
udplite
UDPLITE(4) BSD Kernel Interfaces Manual UDPLITE(4)
NAME
udplite -- Lightweight User Datagram Protocol
SYNOPSIS
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/udplite.h>
int
socket(AF_INET, SOCK_DGRAM, IPPROTO_UDPLITE);
DESCRIPTION
The UDP-Lite protocol provides a partial checksum which allows corrupted packets to be transmitted to the receiving application. This has
advantages for some types of multimedia transport that may be able to make use of slightly damaged datagrams, rather than having them dis-
carded by lower-layer protocols.
UDP-Lite supports a number of socket options which can be set with setsockopt(2) and tested with getsockopt(2):
UDPLITE_SEND_CSCOV This option sets the sender checksum coverage. A value of zero indicates that all sent packets will have full checksum
coverage. A value of 8 to 65535 limits the checksum coverage of all sent packets to the value given.
UDPLITE_RECV_CSCOV This option is the receiver-side analogue. A value of zero instructs the kernel to drop all received packets not having
full checksum coverage. A value of 8 to 65535 instructs the kernel to drop all received packets with a partial checksum
coverage smaller than the value specified.
ERRORS
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 desti-
nation address specified and the socket is already connected;
[ENOTCONN] when trying to send a datagram, but no destination address is specified, and the socket has not 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)
BSD
October 1, 2014 BSD