Programming :: Write To A Port Through QTcpSocket?
Jan 19, 2011
QUdpSocket does have a writeDatagram() method which takes port number and IP address as an argument.
There is no such thing in QTcpSocket.
But there is QIODevice class. Can that be used instead, I can't make out anything with the documentation here:[URL]
View 7 Replies
ADVERTISEMENT
Oct 4, 2010
Is possible to detect port scanning just by using utilities included in linux (netstat, iptables...), Yes there is utility called psad but I would write some scripts for my own and learn something new
writing own Intrusion Detection System? I am not a C++ geeg, so first thing that comes to my mind is that i will use simple BASH SCRIPT that will interact with iptables and monitor user activity, network activity etc. (but I thing that would not be good solution due to performance and capabilities, and also I am not familliar with memory in linux at all). I was reading aboud SNORT HIDS, NIDS... AFAIK some information can be obtainet from /proc but I have no idea which values should be monitored.
View 1 Replies
View Related
Mar 8, 2011
I'm currently developping a C program to drive a Telit GM862-GPS module using the serial port of an embedded board (SBC9261).The communication with the module is based on AT commands : I just send my command to the module, through the RS232 line, and the module answers immediately.Here's an example with a basic command returning the GPS's acquired position, sent with Minicom :
Code:
AT$GPSACP
$GPSACP: 104323.000,4x45.6171N,00x38.6219E,0.8,446.5,3,272.14,0.21,0.11,080311,09
[code]...
View 4 Replies
View Related
Aug 5, 2010
trying read serial COM port and want to write that received data to file, now its writing only one sentence, but i want to write full file which coming on serial port, as i'm sending file from hyper terminal and reading on linux pc, If i put while loop its not writing anything,without while loop its writing only one line and if send big file then application terminates and then writes to file.But i need do write any size which coming on serial port.Finally i want write full file which is coming on hyper terminal, after writing the file it has wait for next data. This is my code,
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
[code]...
View 9 Replies
View Related
Mar 31, 2011
I need to read and write to a serial device. When I connect via gtkterm, I need to toggle DTR before I can communicate with the device . My problem is that I cannot emulate this in C++.
I want to write some code that can setup a comport, toggle the DTR, then read and write strings to the port. However all my attempts have been fruitless. My serial settings are B9600, No parity, no hardware control, 8 bt characters and 1 stop bit:
Code:
#include <iostream>
#include <SerialStream.h>
#include <sys/ioctl.h>
#include <fcntl.h>
using namespace LibSerial;
[Code]...
View 1 Replies
View Related
Oct 4, 2010
Is possible to detect port scanning just by using utilities included in linux (netstat, iptables...), Yes there is utility called psad but I would write some scripts for my own and learn something new
I am not a C++ geeg, so first thing that comes to my mind is that i will use simple BASH SCRIPT that will interact with iptables and monitor user activity, network activity etc. (but I thing that would not be good solution due to performance and capabilities, and also I am not familliar with memory in linux at all). I was reading aboud SNORT HIDS, NIDS... AFAIK some information can be obtainet from /proc but I have no idea which values should be monitored.
View 1 Replies
View Related
Mar 10, 2010
I am trying to send text data from one PC to other using Serial cable. One of the PC is running linux and I am sending data from it using write(2) system call. The log size is approx 65K bytes but the write(2) system call returns some 4K bytes (i.e. this much amount of data is getting transferred). I tried breaking the data in chunks of 4K but write(2) returns -1.My question is that "Is there any buffer limit for writing data on serial port? or can I send data of any size?. Also do I need to continously read data from other PC as I write 4K chunk of data"Do I need to do any special configuration in termios structure for sending (huge) data?
View 4 Replies
View Related
Dec 1, 2010
I have a minilinux that I being working on, the problem now is that the serial ports doesn't seem to work (I have 4 serial ports).They don't write or read.
I run the command setserial g /dev/ttySx and it says that his IRQ are 3 or 4 (3 for ttyS0 and ttyS2 , 4 for ttyS1 and ttyS4)�but when I run the command: dmesg | grep ttyS the IRQ�s are 0 for ALL my serial ports� could be this the reason why my serial ports aren�t working right??? And if it is how can I solve the problem??
View 2 Replies
View Related
Sep 6, 2010
We are trying to create a message forwarder program that receive a message on Port A and pass it on t Port B. Also receive a message from Port C and Pass it on to Port D as follows.
[Code]...
View 4 Replies
View Related
Jan 5, 2011
do you have any code to flash led lights with paralel port (device driver programming)or any lecture about this subject .if there is a working code this would be better ofcourse.
View 1 Replies
View Related
Mar 28, 2011
Is it possible to swap a client ip and port ? This is what I am trying to do. Let say you have Comp1 and Comp2 And you have Server between them. My goal is to get Comp1 and Comp2 know each others IP So Comp1 connects to server And server stores comp1's IP In a text file or other place And Comp2 connect to server And server also stores his info And then both comp1 and comp2 dowload the tex file And use the info on it.
View 9 Replies
View Related
Jun 1, 2010
I have been working on writing a small rs232 driver like minicom for months. I am almost there, I have the interrupt service routine running, I can read() ok. However when I write(), it returns the number of characters written, 1, but nothing is actually written out the port. I researched termios, and they say that serial port programming is really messy in linux/unix.
I am probably not setting up the port parameters correctly, or my write() function is not doing what it is supposed to. As I said, write() is returning successful. Other comm programs run ok (picocom & gtkterm) on my hardware. I am running knoppix/debian on an ancient computer. I saw other guys using slackware.
View 14 Replies
View Related
Nov 24, 2010
I have a serial port program which is reading a string .if(read(readfd,sResult,1)>0)where sResult is unsigned char sResult[10];if sResult is array of 10 then iam getting string perfectly but if iam making sResult only as unsigned char I am getting NULL value CODE BELOW
Code:
unsigned char sResult;
main()
{
readfd = open("/dev/ttyUSB0", O_RDONLY);
if (readfd == -1)
{
perror("READ: open_port: Unable to open /dev/ttyUSB0-
[Code]...
View 2 Replies
View Related
Feb 4, 2011
i am trying to edit sshd_conf files to change the "#Port 22" to "Port 22" from a script.
I have tried this many different ways.
sshs1='s/#Port 22/Port 22/g'
sed $sshs1 /home/l/Desktop/test
the reason i have it as a string in this instance is because $sshs1 gets a variable, but im not working on that right yet. I've tried changing the ' to ` and ". this is what i get:
sed: -e expression #1, char 7: unterminated `s' command
sed: -e expression #1, char 8: extra characters after command
sed: -e expression #1, char 8: extra characters after command
"
sed: -e expression #1, char 7: unterminated `s' command
i know it may have to do with my regex, but i cant seem to find a decent tut.
View 2 Replies
View Related
Feb 18, 2010
I want to do a simple port redirect, i.e. whatever comes trough whatever interface on port AAAA will get redirected to port BBBBI thought that iptables -t nat -I PREROUTING --source 0/0 --destination 0/0 -p tcp --dport AAAA -j REDIRECT --to-ports BBBBhowever it doesn't work, e.g. nc -v -w2 -z localhost AAAA gives:
nc: connect to localhost port AAAA (tcp) failed: Connection refused
while
nc -v -w2 -z localhost BBBB
[code]....
View 10 Replies
View Related
Jun 24, 2010
I just started messing around in Linux programming, and I wanted to create a simple test program to open a file, read to it, and write to it. I can open and read it, but write always gives errno = EBADF. I've messed with file creation permissions and I can figure out why write() thinks it's a bad file descriptor but not read().Here is my code:
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
[code].....
View 1 Replies
View Related
Mar 10, 2011
I need to write a GUI for the web to gather the following info:
Username
Password
SomePlainText
Path1
PathN
Of course, I then need an 'submit' button. I then want to have the user upload all paths supplied from their machine to my server. I hope to work with this data as arguments for a bash script. Also, I need to work with all possible client OSes consistently. What language should be used?
View 3 Replies
View Related
May 30, 2010
Can you offer me the code about fmod() in C. I want to know how this function work, i am very interested in it because i have no idea to implement it, i want to know... how to write the function... not 'how to use the function' can anyone post the source codes of this function here?
View 6 Replies
View Related
Mar 31, 2009
I've been working at learning how to write makefiles and I'm a bit stuck.
I've got a fairly simple project that will eventually be a framework for TCP/IP Communications in evolutionary algorithms that I've been using Eclipse to develop.
For personal development I want to learn how to write makefiles by hand but have gotten kind of stuck
Here is the makefile as it stands now:
Code:
Port and Mailbox are a virtual class and a template class respectively.
I get these errors when I run make:
Code:
So for some reason every single function in the Connection class has been defined multiple times. I assume because it's included as a dependency for multiple targets, but I've seen this in numerous examples that apparently work.
Everything in libpthread is undefined because I'm not linking in the library. I've tried adding the library options to the LDFLAGS variable but that doesn't seem to work either.
View 3 Replies
View Related
Jul 16, 2010
I want to learn to write an USB driver on linux 2.6.x I tried to find some documents but i could not find documents for it . Most of it gave direct driver code as reference.
View 1 Replies
View Related
Feb 26, 2010
I want to write a program (in C), which does 4 or 6 simultaneous calculation. Is there away of doing something like:
do at the same time{
Core 1 do:
this_thing_1
[code]....
View 3 Replies
View Related
Feb 25, 2010
I am trying to write a gui app with python2.6.4 and wx on win XP. I am attempting to resize an image with Imagemagick from within the program using os.popen and os.system in a thread.
Code:
os.popen("mogrify -resize " + str(x) + "x" + str(y) + "!" + " images/static/" + my_ref + ".gif")
orCode:
os.system("mogrify -resize " + str(x) + "x" + str(y) + "!" + " images/static/" + my_ref + ".gif")
they both work as far as resizing the image but when os.system is used a command shell opens during the mogrify and when os.popen is used the command shell does not show but the rest of the program freezes until mogrify is done.
I would prefer that the program did not freeze during this process and the command shell did not show.I have tried using wx to scale the image but the scaled image looks crappy.anyway is there a way to use os.system and not have the shell show?
View 2 Replies
View Related
Mar 24, 2011
I'm trying to write a toy linux shell. For starters this is what I'm trying to do:
1. Start a new process with fork.
2. Execute a program in the new process with execl().
3. Redirect the output from the new process from STDOUT to another file descriptor, using dup2(2).
4. In the parent process, read the output from the child process and write it to the screen.
Creating a new process and executing a program in it is no problems, the problem is that I can't seem to capture the output from it in the parent process.
Code:
//digenv
//C++arl 2011-03-24
#include <stdio.h>
#include <sys/types.h>
[code]...
View 14 Replies
View Related
May 2, 2010
I have a mail server i need it to send message via port 587 not port 25, i make some changes to my postfix server which i use and it is already successed making a telnet to 587 port like it :
[Code]....
View 3 Replies
View Related
Jun 3, 2011
[code]...
I manage to write apr4sens into file,works fine.But how to write it into array,which I could later reshape and so on. I tryied like this
group=apr4sens. It doesn't work.
View 1 Replies
View Related
Jan 30, 2010
I'm trying to write a .sh script that allows me to run multiple other .sh scripts at once.
My problem occurs within a Variable:
I have set
S1 to S7 to be the name of the .sh
A="7"
B="S$A"
C="$S$A" <- and this is where my problem is
I want C to be the content of S7 till S1 but if I run this line it will of course look for the content of S and link it with the content of A.
How can I correct this?
Edit:
WHERE="/home/X/Y/"
SH=".sh";
A="7";
B="S$A";
C="$B";
[Code].....
View 6 Replies
View Related
Nov 29, 2010
i have a text file like
abc abc abc abc
abc abc abc abc
--- --- --- ---
i want to add a string xyz to end of each line..
abc abc abc abc xyz
abc abc abc abc xyz
abc abc abc abc xyz
--- --- --- --- xyz
--- --- --- --- xyz
how do i do this in bash?
View 13 Replies
View Related
Apr 6, 2009
I am trying to write a CMakeList.txt for a project (A). The project needs to use the library of another project (B). For gcc, using -L <path> -ldl works. How can I convert that into cmake file? I tried include_directories, that doesn't seem to work
View 3 Replies
View Related
Dec 29, 2010
I am trying to write my first small project with C++ - implement stl list like collection class. This is what i have a the moment:
Code:
#ifndef GUARD_link_list_h
#define GUARD_link_list_h
template <class T>
struct Node {
[code]....
View 1 Replies
View Related
Mar 29, 2009
I want to know how to write a script that would use the standard Linux FTP command to download all the mp3 files from a FTP server cause GET *.mp3 doesn't work. Also how would I write the same script but as a batch file to be run in windows cmd through the windows native FTP command?
View 4 Replies
View Related