Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have a TCP server listening on a localhost's port so I need a software that can be used to establish a TCP connection to the server and then send binary data, not ASCII.

For example, I want to send a message that looks something like this (8 bytes written as hex):

FF00FE1200FF28CA

Are there any such programs freely available?

share|improve this question
add comment

2 Answers

up vote 7 down vote accepted

netcat naturally - you can pipe the data to netcat from another programme or file. And here's a windows port

share|improve this answer
    
there's a netcat build for windows –  ultrasawblade Apr 4 '11 at 13:54
    
+1 for netcat.. –  ta.speot.is Apr 5 '11 at 3:20
add comment

The Python programming language interpreter in interactive mode can be used for this.

$ python
>>> import socket
>>> s = socket.socket(socket.AF_INET6, socket.SOCK_STREAM)
>>> s.connect(("localhost", 22))                  # connect to address ("localhost", 22)
>>> s.send(b"\xff\x00\xfe\x12\x00\xff\x28\xca")   # send the data from your example
8                                                 # send() returns number of bytes written
>>> s.recv(10)                                    # receive 10 bytes

Some might prefer Ruby.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.