Addressing UDP datagrams in UNIX

Thread Tools Search this Thread
Top Forums Programming Addressing UDP datagrams in UNIX
# 1  
Old 08-14-2001
Addressing UDP datagrams in UNIX

I am having troble to send a UNIX datagram to a NT machine. I didn`t realize yet how to define the destination address on the
sendto() function call.Simply writing "xxx.zz.yy.pp" for the IP and xxxx for the socket doesn´t work!!! Can anyone help me with that?
# 2  
Old 08-18-2001
This involves lots of winsock and other NT expertise and this is not the theme of this site.

You might try an NT site for how to debug and program their TCP/IP stack.
# 3  
Old 08-20-2001

There is nothing to do with problem is that I am having
difficulties addressing a UDP datagram on the UNIX side.
the sendto() function has a parameter called sockaddr, which is
a struct and I don`t know how to define it correctly so that my
datagram can be sent to a given IP address and a given socket.
# 4  
Old 08-21-2001
It's something like this:

struct sockaddr_in  server;

bzero((char *) &server, sizeof(server));
server.sin_addr.s_addr=inet_addr(---address goes here---);
serv_addr.sin_port=htons(---port goes here---);

No money back guarantees here, but it's at least close.

However, after the socket() call and before the sendto() call, you will need a bind() call. And bind() also requires an address structure. I'm guessing that you don't have that yet either. Remember that a socket is 4 data: local address, local port, remote address, remote port.
# 5  
Old 08-22-2001

Thank you!!!!

I will try with that!!!!
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

32 bit process addressing more than 4GB

Hello for all, I am testing the behavior of a 32 bit application running on Solaris 5.10 (SPARC), and realize it reaches 4GB of memory and then crashes. It doesn't matter the amount of used memory as application is intended to perform many transactions; rather, what I want to achieve is to... (2 Replies)
Discussion started by: Leito7824
2 Replies

2. IP Networking

Addressing question

This is probably a stupid question but I am finding a tricky issue on my Solaris machines right now. I changed the hostname for my servers as requested by my superior. I had one server that lost it's entire network configuration when I rebooted. I reconfigured it with it's address and I can... (2 Replies)
Discussion started by: lnxjenn
2 Replies

3. Programming

Memory addressing question

Forgive me if this sounds like a newbie question. Any time you obtain a stack address from a pointer, what is this relative to by default? Is it the extra segment, the stack segment, what? How do you change change the relative positioning in memory? Thanks in advance (1 Reply)
Discussion started by: stevenswj
1 Replies

4. What is on Your Mind?

Electronic Mail Addressing

"A Directory of Electronic Mail Addressing & Networks" by Donnalyn Frey and Rick Adams (O'Reilly & Associates, 1993), Xerox Grapevine, DECNET. The book tells about lots of different ways to present an email address. What i know of are Internet (user@host), UUCP (host!user) and DECNET (host::user)... (2 Replies)
Discussion started by: Action
2 Replies

5. Shell Programming and Scripting

addressing variable content...

I want to address a variable content whose name is/matches the content of a given other variable. i.e. set name=´sam´ set ${name}_age=´27´ So, by typing: echo ${name}_age I correctly obtain: sam_age By typing: echo $sam_age or echo ${sam_age} I correctly obtain: 27 But how can I... (3 Replies)
Discussion started by: sobolev
3 Replies

6. SCO

How to stop A UDP protocol on Unix

Dear All, Kindly guide how to stop UDP protocol on Sco Unix release 5.0 Regards (2 Replies)
Discussion started by: sak900354
2 Replies

7. Linux

Linux IP addressing Problem

hello, we are having a LAN of about 100 nodes each installed with windows 2000. the default gateway ip address of each system has been assigned the IP of a personal router which connects us to the internet. and offcourse there are a few DNS address also. the ip address range from to... (5 Replies)
Discussion started by: vibhory2j
5 Replies

8. HP-UX

scsi floppy drive addressing

Does anyone know of a site that documents the various addressing schemes used with SCSI floppy disk drives? (5 Replies)
Discussion started by: Drew_Harrison
5 Replies

9. IP Networking

Dual IP addressing

I have a Unix application server with an internet IP address on it for a gateway and a Unix web server with the Internet IP as well configured for its gateway. Now the problem I have is this: due to these gateways, the application server can't communicate with our internal LAN. Therefore, it... (2 Replies)
Discussion started by: Ronny
2 Replies

10. IP Networking

IP Addressing with Digital Unix

I'm trying to set up an IP address on a Digital Unix box. I would like to know the commands in order to do so. thanks (5 Replies)
Discussion started by: lavelyj
5 Replies
Login or Register to Ask a Question