03-16-2004
I don't know which sockets you use ..
I think for a chat server it is datagram sockets that we generally use. If so you can transmit your array to the server by making use of a buffer variable on both the client and server.
you use the function htons(); as part of the POSIX standard..
which converts the array to the network byte order ..
In the server use ntohs(); to diassemble.
bye
Mani..
6 More Discussions You Might Find Interesting
1. UNIX for Advanced & Expert Users
hi,
if i try to 'su' to root and enter the wrong password, the failed su is broadcastet to all user logged in on the machine.
Anyone know where i can stop that broadcast?
thanks
Lazzar (3 Replies)
Discussion started by: Lazzar
3 Replies
2. UNIX for Advanced & Expert Users
hi
I wanna make radio broadcasting from my web page. I am planning to use a linux server. I have no idea about how can I do :( I heard about RealPlayer can be used but ,unfortunatelly, I don't know how!
Any suggestions and advices are welcome....
thanks... (4 Replies)
Discussion started by: fnoyan
4 Replies
3. Solaris
Hey guys...hopefully this will be a fairly easy one.
I've got an old SPARCstation 5 running Sun 5.5.1 that I just hooked up to the network so that I can run HP OpenView. The box is working fine, but it is broadcasting as a boot server. In other words, when co-workers come in and get ready to log... (2 Replies)
Discussion started by: cdunavent
2 Replies
4. Solaris
I am trying to find an approach that has been effective for automating the installation of Solaris 10 x86 using Jumpstart technology. I have configured an Jumpstart server and a Solaris dhcp server with appropriate macros for passing the client information about its boot environment. The problem is... (7 Replies)
Discussion started by: chajo19
7 Replies
5. UNIX for Beginners Questions & Answers
I have a textfile with a list of strings I want to monitor in my network.
alertlist:
hans
franz
tanzSo it can output for me whenever the a strings it matched:
#!/bin/sh
while : ; do
testfile="/var/media/ftp/alertlist.txt"
] && echo "${testfile##*/} exists." || echo "${testfile##*/}... (9 Replies)
Discussion started by: lowmaster
9 Replies
6. UNIX for Beginners Questions & Answers
I wish to pull out a list of all user ids on the system, including the privileged ids, the groups to which they belong to. Sometimes after deleting an id also, its home dir does not get deleted or an entry is left behind in /etc/passwd.
Can someone help me with a script to achieve both. (2 Replies)
Discussion started by: ggayathri
2 Replies
LEARN ABOUT X11R4
byteorder
BYTEORDER(3) Linux Programmer's Manual BYTEORDER(3)
NAME
htonl, htons, ntohl, ntohs - convert values between host and network byte order
SYNOPSIS
#include <arpa/inet.h>
uint32_t htonl(uint32_t hostlong);
uint16_t htons(uint16_t hostshort);
uint32_t ntohl(uint32_t netlong);
uint16_t ntohs(uint16_t netshort);
DESCRIPTION
The htonl() function converts the unsigned integer hostlong from host byte order to network byte order.
The htons() function converts the unsigned short integer hostshort from host byte order to network byte order.
The ntohl() function converts the unsigned integer netlong from network byte order to host byte order.
The ntohs() function converts the unsigned short integer netshort from network byte order to host byte order.
On the i386 the host byte order is Least Significant Byte first, whereas the network byte order, as used on the Internet, is Most Signifi-
cant Byte first.
ATTRIBUTES
For an explanation of the terms used in this section, see attributes(7).
+-----------------------------------+---------------+---------+
|Interface | Attribute | Value |
+-----------------------------------+---------------+---------+
|htonl(), htons(), ntohl(), ntohs() | Thread safety | MT-Safe |
+-----------------------------------+---------------+---------+
CONFORMING TO
POSIX.1-2001, POSIX.1-2008.
Some systems require the inclusion of <netinet/in.h> instead of <arpa/inet.h>.
SEE ALSO
bswap(3), endian(3), gethostbyname(3), getservent(3)
COLOPHON
This page is part of release 4.15 of the Linux man-pages project. A description of the project, information about reporting bugs, and the
latest version of this page, can be found at https://www.kernel.org/doc/man-pages/.
GNU 2017-09-15 BYTEORDER(3)