473,395 Members | 1,738 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

host to network

How can I do a host to network conversion (similar to htonl) in
JavaScript? i.e. convert to network byte order irrespective of whether
host is little or big endian.

TIA,
KK

Dec 5 '06 #1
2 2077
Kelvin wrote:
How can I do a host to network conversion (similar to htonl) in
JavaScript? i.e. convert to network byte order irrespective of whether
host is little or big endian.
JavaScript (at least 1.x) does not have a byte data type so I am not
sure where you are dealing with bytes and endianness at all. In what
context/host are you using JavaScript?
--

Martin Honnen
http://JavaScript.FAQTs.com/
Dec 5 '06 #2

Martin Honnen wrote:
Kelvin wrote:
How can I do a host to network conversion (similar to htonl) in
JavaScript? i.e. convert to network byte order irrespective of whether
host is little or big endian.

JavaScript (at least 1.x) does not have a byte data type so I am not
sure where you are dealing with bytes and endianness at all. In what
context/host are you using JavaScript?

OK, let me try to make this clearer. In C htonl will convert an IP
address from host byte order to network byte order. On a big endian
processor it does nothing and on a little endian one it reverses the
order of the 4 bytes that make up the address. Is there a similar
function in JavaScript?

K

Dec 13 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Anand Pillai | last post by:
I would like to add a feature to one of my network programs. The requirement is to find out if a server is alive by sending it requests. I know of the standard ICMP ping, and searched for python...
1
by: Fred | last post by:
I just started using MySQL, and cannot find how to configure host access in the my.cnf file. I want to be able to allow access to a MySQL database from a remote host, and also from a particular...
1
by: Jonathan Lee | last post by:
Dear all I want to program implementation scan all of the IIS host or SqlServer host in the local network. But I only can search all of computer in the local network now. And how can I determind...
2
by: Jeff | last post by:
I have an ASP.NET web page accessing a SQL database. I've used VS to build the app and stored it in the eNPTest02 directory of my localhost on my development machine. The database is on the web. ...
4
by: Terry Olsen | last post by:
I have a list of pc names that I need to go out and pull information from. If they are all online, great! But when a PC is turned off (not online), the program hangs for a good 40 seconds before...
1
by: srinu | last post by:
Hello, We had one webserver based on a linux machine. The website is fully function and designed by a different person. Now we moved the machine from one IP to another one. I changed the...
6
by: test2000 | last post by:
Hello I'm trying to write a javascript that checks if a server/host is available. To be more precice. I would like to check if the browser can read an XML file from a server. If not the script...
2
by: martin lanny | last post by:
Simple network scanner is a part of my dotnet solution. It pings ip addresses in a selected network range and gives me the response time for each computer it finds. Anyhow, I would need to...
1
by: malooga | last post by:
Hello, I'm having a problem connecting to DB2 on a remote iSeries host from a Linux server, both of which reside on my company's internal network. I'm using the IBM Linux Client V9.1. When I try...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.