Programming :: Test If Client Or Server Has Data To Send C++?

Feb 16, 2011

If you have a proxy and receive/send data from/to both the client and the server,is there a way to test what part has data to send(client or server) ?

View 1 Replies


ADVERTISEMENT

Programming :: Detect A Closed Tcp Client Connection When Client Is Only Receiving Data ?

Mar 9, 2011

I am writing a TCP server in C, and the server listens to incoming client connections and accepts them. It then creates a thread to handle the client. The clients are expected to only receive data from my server and not send any data. So if I use a select() call with a recv(), I believe that the recv() will just block forever since there will not be any data coming from the client. If I use a non-blocking recv(), then this will just return a 0 which tells me nothing because the client is not expected to send any data. I am not sure if I have misunderstood some socket concepts, but I need a solution to detect when the client has disconnected so that I can close the socket and stop sending data to the client. As I understand it, simple ACKs etc are not captured by the recv(), and only data sent by the client will cause recv() to return a non-zero value, so I am not sure how to know when the client has disconnected.

View 7 Replies View Related

Programming :: Periodically Send Message To Client?

Jun 14, 2010

i have a client and server program in C. in that program server is requesting some parameters from client (like systems up time, total memory, no of process running etc).for this i used switch statements. but the problem i am having with this is that,
1. it is always going in default case on client side.2. and i also want my program to send requests/messages to client periodically. means after some interval (say after every 2,3 mins) server sends next request to client.

View 3 Replies View Related

Server :: Bugzilla Error: Can't Send Mail To User@test.local.com

Apr 5, 2011

The thing is we have 2 servers one is bugzilla + proxy other is mailserver (internal)

The thing is when my dev team files any bug the bugzilla can't send mail to a user user@test.local.com

P.S:i am actually having problems since the sudden power cut and server restarts
the local mail server is having zimbra package installed

View 2 Replies View Related

Programming :: Send Data Through Serial Port Using C?

Oct 20, 2009

I am not a profession programmer. I have to write a C code which send some command to attach display using C program. Can any one please help me in this regard.

View 3 Replies View Related

Programming :: Send /receive Data Through Serial Port In Fedora?

Dec 27, 2010

I am doing work on serial port. I want to send/receive data to/from Microcontrolar through serial port. But I don't know how to initialize, receive and send data to Serial port. i am new in fedora so i hav'nt any deep concept of fedora.can anyone send me C code , which communicate through serial port in fedora (or atleast help me). I am using Fedora 11.

View 6 Replies View Related

Networking :: Send Cdrom0 To SSH Client/server?

May 7, 2010

Is it possible for a client to "export" or "send" it's /dev/cdrom0 to a server via SSH? I have managed to st up a connection with Xserver so I can see the servers gnome interface in my ubuntu client.

View 9 Replies View Related

Server :: Send Traffic Down WAN Link Depending On Client IP Address Range?

Apr 15, 2011

I am running Debian Squeeze with the following basic services running:DNS
DHCP
Samba
Squid

The server is setup with three NICs: eth0 (WAN1), eth1 (WAN2), and eth2 (LAN).The server addresses clients with an IP range of 10.0.30.1 - 10.0.30.254. Some clients will be set with reservations so they fall into the 10.0.40.1 - 254 range.

What I want to do is have any outgoing external traffic coming from the first range (10.0.30.0) to use WAN link 1, and any outgoing external traffic coming from the second range (10.0.40.0) to use WAN link 2.

I have sort of got something working. I have created a bare minimum transparent squid3 setup on port 3128, and set the iptables as follows:

Code:
iptables -t nat -A PREROUTING -i eth2 -p tcp -m tcp --dport 80 -j DNAT --to-destination 10.0.0.1:3128
iptables -t nat -A PREROUTING -i eth0 -p tcp -m tcp --dport 80 -j REDIRECT --to-ports 3128
iptables -t nat -A PREROUTING -i eth1 -p tcp -m tcp --dport 80 -j REDIRECT --to-ports 3128

I can get internet access, however obviously it only goes through one WAN link. It also seems slower than it should be. I experimented with tcp_outgoing_address, but seemed to not be my friend.

View 4 Replies View Related

Networking :: Rsync Sending Data From The Client To The Server?

Jun 29, 2010

shed some light on what I am doing. I am wondering if I just havehings back to front.Server (MESH):Fedora 13Firewall ports open tcp 22(ssh), tcp 873(rsync)sshd service started

View 5 Replies View Related

Server :: Nfs - Mount Shared Data From Client Machine

Feb 9, 2010

i have installed nfs server on my redhat machine.when i want to mount shared data from client(suse)machine the following error occur. "mount.nfs: mount to NFS server '10.3.31.146:/home/usbtest' failed: System Error: No route to host" both machines ping each other successfully.

View 1 Replies View Related

Networking :: Socat - Sending Binary Data From Client To Server

Apr 15, 2010

I am trying to redirect connection to port 8980 to execute a telnet command to a local machine
by issuing the following command :
In Server 1 :
socat TCP-LISTEN:8980,fork EXEC:/myscript,reuseaddr

My script contains
#!/bin/bash
telnet 192.168.20.12 //local Server 2

I am sending Binary data from the client to Server 2 via Server 1. So it happens that I have some characters in Hex translated to special characters in ASCII like open brackets or Commas etc.. and that closed the socket between the two machines.

View 2 Replies View Related

Programming :: Send Some Data From A System To A Windows System And Vice Versa?

Mar 4, 2010

How can I do some socket programming using which I can send some data from a linux system to a windows system and vice versa. Can we do that using the IO:Socket:INET perl module??

View 10 Replies View Related

Programming :: Socket And Timer Programming - Server Doesn't Execute Any Msg Which Client Sent

May 16, 2011

i have a server program which accept multiple client connection and am using polling. like every 2 secs it will look to client whether any data is received after it binded. i have used setitimer but there is runtime error i got.. the server accept all client connection but doesn't execute any msg which client sent.

#include<stdio.h>
#include<stdlib.h>
#include<sys/socket.h>
#include<sys/types.h>
#include<netdb.h>
#include<unistd.h>
#include<pthread.h>
#include<string.h>
[Code]....

View 1 Replies View Related

Programming :: Writing A Script To Do A Speed Measurement From ISP's Test Ftp Server

Feb 5, 2010

I am writing a script to do a speed measurement from my ISP's test ftp server. To do this interactively I connect to the server, enter credentials, enable hash and download a test file. The process concludes with something like

Quote:

################################################################
226 Transfer complete.
1048576 bytes received in 2.87 secs (356.6 kB/s)

So I entered the credentials for the server in my .netrc file and created a little bash script as follows

Quote:

#!/bin/bash
cd ~/Desktop
# poiuytrewq is the limit string of the "here" document

[code]...

The script executes as expected EXCEPT that I do not see the statistics at the end of the transfer. It terminates thusly

Quote:

#################################################################################################### ############################################
ken@taylor12:~/Desktop$

I have tried adding another ftp command such as ls to the end of the "here" document (in case the results were clipped by the bye command) but to no avail. The ls result immediately follows the ### - no stats I am at a loss.

View 8 Replies View Related

Ubuntu :: Can't Send From Own Mail Server With Mail Client (Thunderbird Or Evolution)?

Jun 1, 2011

I have set up postfix and dovecot as per the Ubuntu anual and appear to have a functioning mail server.Using the sendmail command I can send mail and I receive mail in ~/Maildir. Using Thunderbird I can read any mails received but I can't send any mail from Thunderbird. I have tried with both STARTTLS and SSL/TLS and whilst I get the prompt for a password I keep getting the message my password for my server is wrong.I have ports 25, 465, 587 and 993. Is that all the right ports?When I ping my domain name it resolves to my router name whereas I believe it should resolve to my IP. Could there be a problem with my host file? I've had a play but to no avail.Here's the error in mail.log.

Code:
westwood@westwood-desktop:/etc$ tailf /var/log/mail.log
Jun 1 19:00:33 westwood-desktop postfix/smtpd[2376]: warning: localhost.localdomain[127.0.0.1]: SASL LOGIN

[code]....

View 2 Replies View Related

Kernel :: Send Pages Of 4096 Bytes From Layer Of Server To Layer Of Client Over A Network?

Jan 13, 2010

im trying to send pages of 4096 bytes from kernel layer of server to kernel layer of client over a network. previously i tried the foll. code , for data less than a 100 bytes it worked fine , but for something larger than that the computer hangs......(even the dmesg's wont say why) i also wanted to know how we could use the 'sendpage' function to solve this problem.

Code:

CLIENT'S KERNEL MODULE
struct iovec iov;
char buf[1024];

[code].....

View 1 Replies View Related

Server :: How Long Normaly Keep The Mail Server Send Mails On The Outbox Queue And Try To Send

Apr 8, 2010

How long normaly keep the mail server send mails on the outbox queue and try to send? What about hotmail, gmx and gmail mail server?

View 1 Replies View Related

Programming :: Send A Request To A Http Server Without Using Sockets.

Jul 8, 2011

Hi, is it possible to send a request to a http server without using sockets?

View 7 Replies View Related

Programming :: Socket C++ / Send And Receive Messages In Server?

Jan 2, 2009

I'm trying implement a small server for a university work, my server is creating, binding and listening but it don't accept any connection, these are the files I'm using in server:

Code:

// Definition of the Socket class
#ifndef SOCKET_H
#define SOCKET_H
#include <sys/types.h>
code....

I've made a client just for test it, but no ones run well, the server is always returning -1 when accept is called!!

What should I do to send and receive messages in this server??

View 3 Replies View Related

Programming :: Perl - UDP Server Receive / Send Packet To Host

Apr 1, 2010

I have found many examples out on the www for creating udp servers with sockets. The problem I am running into is after I receive the packet from a host I need to be able to send a custom made packet(I'm using RawIP / NetPacket to make my packet) back to this host. The only way to do this is seemingly through the send() function. This function however doesn't appear to allow me to specify which host to send my packet to.

View 2 Replies View Related

Programming :: Server With 2 Threads Per Client?

Nov 25, 2010

In all the examples I have found the server accepts the client's conection, proccess the data received and close the socket. In an very schematic way it would be something like:

Code:

client_thread{
select to see if there is data to read from socket fd
if there is something to read{

[code]....

Should I use mutexs or semaphores to block the socket fd before read and write or it is not necesary?

View 4 Replies View Related

Programming :: Encryption From C Client To Php Server?

Jan 12, 2010

I looking for an algoritm to encrypt some data sent from a c program(client) to a php server(can be in perl or cgi-bin) over the internet. How should i send it in c? Some http call? Or it can be in via a perl script. Then i need some basic algoritm to encrypt it. Any ideas. How do i save the key in the c program? Just something basic so its not clear text. This is not for a bank or visacards etc

View 2 Replies View Related

Programming :: Creating 2 Sockets In Client / Server?

Jun 9, 2010

I have a problem creating my second socket in client file. the program was running well but when I try to add another socket to connect to the same server, I got a problem connecting to the first socket! it doesn't make sense. the original code was:

sockfd[i] = socket(AF_INET, SOCK_STREAM, 0);
if(sockfd[i] < 0) error("(MAIN) - Error openning socket 1");
port_num[i] = portno;
bzero((char*) &serv_addr[i], sizeof(serv_addr[i]));

[Code].....

View 1 Replies View Related

Programming :: Chat Socket Between Client And Server

Mar 17, 2011

I want to built a Chat Program (based on Socket connection) between client and server. I use the GTK+ &GLADE graphic tool. Can you send me the code for this program or any material to learn. Also, I want to know how to show the input to text view (in GTK+&Glade).

View 3 Replies View Related

Programming :: Connect A Client To A Server In Windwos?

Mar 25, 2010

I am getting this error when i try to connect a client to a server in windwos ,anybody knows why ?

View 3 Replies View Related

Programming :: Closing Multiple Client Sockets In Server ?

Nov 30, 2010

I have written a server application which has select for both incoming new client connection requests and incoming data from client. I am able to process incoming connection requests and client data.

For example, server has 8 clients connected to it. If client 3 disconnects from server, how will server come to know this client has disconnected and to close its client socket fd gracefully? Does server's select get data on that client socket fd as 'close' data or any error code in recv() function that notifies server to close this client socket fd? Also if client disconnects abruptly without sending close request to server, how should server handle this? Does server get "EPIPE" error?

View 1 Replies View Related

General :: Single Server And Multiple Client Programming In C ?

Jul 1, 2010

I am new in client server programming and i have written code for single server to single client communicating one port(3490). but i have no idea how my single server will be communicate with different client on different port.how this will be happen ?

Any idea to understand the logic or send any good link or any piece of code in c , i searched on net but all help was mostly for java progamming.

View 1 Replies View Related

Programming :: Connection Refused In Client Server Program

Oct 23, 2010

I wrote a simple client server socket program in C.

View 1 Replies View Related

Programming :: How Could Server Detect Closed Client Socket Using TCP And C++

Aug 6, 2010

Reading some examples on net and copying some codes I was able to build a (frankstein) server that accept connection from one client and receive and send messages to it. The big problem that shows up is that I don't know when client disconnects from my server.

I've been looking for a solution, but no success. I'd read about SO_KEEPALIVE option (which could solve my problem), but I don't know how to use it (how to check the value of it).

I can't use ping because the server (machine) could be running, but not the client (software).

Anyone knows a good tutorial or how to (for beginners like me xD) of TcpIp sockets using c/c++ and how to detect when a client disconnect?

I don't know sockets very well.

View 6 Replies View Related

General :: Test Data Transfer From System To Its Box Pc?

Mar 6, 2010

I build a new test machine where i need to bring data from live machine. the data is kind of flat files and some propreitary application axigen mail server.

now what i am suffering from, which commands to do first practise. there is remote site with 1mps speed of wireless between live and test machine. on daily basis aprox 14gb .tar.gz files it need to move it.

i found scp,rcp,rsync,sftp etc. which is fastest way to replicate or copy to remote machines.

the data is on live machine /var/opt/application and on remote same directory too /var/opt/application

i try using scp it take aprox 8-10 hours to copy single 14gb file.

if possible where to see such commands logs results, if anything get down error discontinue while copying.

View 3 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved