C :: Netstat And PS Commands For Client / Server Socket Programming

Mar 3, 2013

I made client server program with fork ,without using signal handler because I want to see the status zombie for parent server, but when i execute "ps" command i didn't see anything for server or client pid or ppid ,i wonder about how to show the server and client process coz when i execute commad "ps" i saw only ps and bash processes???

View 1 Replies


ADVERTISEMENT

C/C++ :: TCPIP Socket Client Programming In Redhat Linux Using Eclipse CDT

Mar 16, 2014

This is my sample socket tcp ip program , problem here is when i give working ip address and port number, it is showing default ip address as 127.0.0.1 and it is Waiting on (1978=port number) i.e., "connection on %d...", SERVER_PORT.

void socket_server_demo(void){
int iserver_socket = -1;
int iclient_socket = -1;
unsigned char bTemp[1024];
unsigned int iTemp = 0;

[Code] ....

View 1 Replies View Related

C++ :: Client Server Programming Using TTcpServer?

Jun 23, 2013

I am using the following code that I copied from a website to send some numbers using TTcpServer in C++.

void __fastcall TForm2::Button1Click(TObject *Sender) {
//Creating a stream
std::auto_ptr<TMemoryStream> myStream(new TMemoryStream);
for (byte i = 0; i < 9; i++) {
myStream->WriteBuffer(&i,1);

[code]....

I do not understand what is being sent in the byte variable, nor why a byte variable was used. I want to send some strings instead of numbers, but I don't understand what's taking place so I can't identify what to change.

View 2 Replies View Related

C/C++ :: Client To Client Communication Using Network Programming?

Feb 8, 2015

I am trying to make kind of a messenger using Socket/Network Programming

My program should allow clients to register or sign in, after they are signed in they should see a list of the other signed in people whoever I select from that list I should be able to implement using multiple threads as well.

I have done this much:

User.txt file

ahsan,1234
bilal,1234
pappu,1234
babu,1234

Client.c

#include <stdio.h>
#include <string.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <stdlib.h>
#include <unistd.h>
#include <pthread.h>

[code]....

Now issue is in this code I am getting error SEGEMENTATION ERROR, CORE DUMP

View 5 Replies View Related

C :: UDO Socket Programming

Dec 18, 2014

I am trying to test my client-server socket program wherein the client connects to the server,client sends a message, server receives it and echo back to the client.So far, in the program server receives the message from the client, prints it BUT when it tries to send the message back to the client it shows an error.

sendto(): Invalid argument.I am new to socket programming.

Code:

//Server
#include<stdio.h> //printf
#include<string.h> //memset
#include<stdlib.h> //exit(0)
#include<netinet/in.h>
#include<sys/socket.h>
#define BUFLEN 512 //Max length of buffer
#define PORT 10003 //The port on which to listen for incoming data
}

[code]....

View 3 Replies View Related

C :: Socket Programming Getting Segfault

May 22, 2013

I am trying to send a packet across a client/server communication. I am getting a seg fault (while running the program(It compiles fine)) when I try to read the neighbor file, You should be able to see this below the comment /***** Read neighbor file***/ :

Code:

#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <netdb.h>
}

[code]....

View 2 Replies View Related

C :: Socket Programming And Console Control

Jan 4, 2014

I would like to make a program for final project, which can let me send any file to my computer at home, and i can access any files in my computer when i am not at home.sending and getting file will be with socket programming.

i would like to reach all folders in computer, not only the folder, where client program exist. how can i access other folders at remote computer by using my program?

View 4 Replies View Related

C :: Address Family Not Supported By Protocol In Socket Programming In Linux

Oct 31, 2013

I am writing on C simple socket programs in Linux. I wrote client and server C programs. My client program is Code: #include<sys/socket.h>//for socket(), connect(), sendto() and recvform()

#include<sys/types.h>
#include<netinet/in.h>
#include<netdb.h>
#include<stdio.h>// for printf() and fprintf()

[Code]....

I am just testing whether can connect or not. I run server program first and client later. But when I run client, it showed that "Address family not supported by protocol".

View 3 Replies View Related

C :: Socket Programming Support Multiple Ports - Defined Variables

Sep 3, 2013

I want to put my socket programming example of how it can support multiple ports. I want to make the process more requests from distributing particles to create non-blocking structure

ports support ports defined variable.

Code:
#include "stdio.h"
#include "stdlib.h"
#include "unistd.h"
#include "errno.h"
#include "string.h"
#include "sys/socket.h"

[Code] .....

View 2 Replies View Related

C++ :: Connecting Client And Server App

May 30, 2013

I need to create a client and server program. The client will have a GUI that will display all the available servers (since more than one will be running) in a list box.

I’m guessing a TCP connection will be the best method here, but how will the client find the servers to connect to? I won’t know the IP address of the server because anyone could take the server program and run it on their computer and the client would have to find it.

Is there some way to make the server send some kind of signal that only the client application will be to connect to? So the server will be sending out a signal, the client finds the signal and connects to the server. Is this possible?

i also need to be able to store the IP address the client selects so when the client application is run again it will automatically connect to the server that was stored.

View 19 Replies View Related

C++ :: Multithreaded Server And Client

Apr 28, 2014

I need the code for multithreaded server and client code. one server and two or more client connect to server.

Without fork(),semaphore(),etc

View 1 Replies View Related

C++ :: Can Be Used For Server Side Programming

Nov 28, 2013

I know this question must have been asked before, but the problem that I am facing is that I am using a library PoDoFo to parse PDF files. It seems that it is only compatible with C++.

Now I want the application to be web-based. That is, the user uploads a PDF file on the server, the server parses it and the parsed content is then sent back to the user.

Is such a thing possible with C++, or maybe any good work-arounds? Or should I look at server-side scripting languages like PHP and their respective libraries?

View 8 Replies View Related

C :: Client Not Receiving Time From Server

Sep 2, 2013

I'm building a client server which is communicating.I am trying to use the function recvfrom, but have several bugs, so I might have the recvfrom function in the wrong part of my code.

Code:

int talk_with_server(int fd) {
printf("Test.
");
char buf[LEN];
int n = read(fd, buf, LEN);

[Code]....

View 1 Replies View Related

C :: Server-client File Transfer Using UDP

Sep 1, 2013

I have to make a server-client file transfer using UDP . I have created a basic server which receives message sent by client . That's all. Now comes the major part :-

1. The message sent by client is the name of file
.2. Now the server checks whether there exists this file or not .
3. If there exists it sends the file to the client and it also keeps the count of the number of requests of file made by the client . Here is the Server Code

Code:

#include<sys/socket.h>
#include<arpa/inet.h>
#include<stdio.h>
#include<unistd.h>
#include<fcntl.h>
#include<sys/types.h>
#include<string.h>
}

[code]...

The server reads the data from file and writes into it and send to the client , On the other end client receive the data and make duplicate of this file and write into it. But on compiling it gives error in reading the file.

View 4 Replies View Related

C/C++ :: Send Message From Server To All Client?

May 30, 2014

First of all i create single server single client program and then using thread i make multiple client to connect to server.

while(true){
csock = (int*)malloc(sizeof(int));
if(nClient<=maxClient){
if((*csock = accept( hsock, (SOCKADDR*)&sadr, &addr_size))!= INVALID_SOCKET ){

[Code].....

The clients send message to the server and server echo back the message to that particular client. But i want that the server will echo back ones's message to all clients. Suppose 5 clients are connected to the server. So whenever one client send a message to the server, the server will send that message to all 5 clients.

View 1 Replies View Related

C# :: Stream Video From LAN Server Onto Client PC?

Oct 9, 2014

I have loads of movies on DVD and they are all on my media server, but the media server doesn't actually allow streaming to be done, the movies are just stored in a folder on the desktop.

My goal would be able to host all my movies on my LAN server, then build an application to run on a windows based PC at home, not over the Internet just over LAN. For example, say the server I have at home had all the movies in a folder on the desktop, then when I start the client on another PC or laptop in my house, I could view all the movies, choose which one and then stream it to that client PC. I am using C#.NET WPF visual studio.

Maybe I could use something like VLC player to play the movies but I would want to build an client application to view the movies and search for them on the server where the movies are stored. Also I know there are other media streaming programs out there but I want to develop my own one for my uses.

View 8 Replies View Related

C# :: Cannot Send Data From Client To Server

Oct 26, 2014

i am making a client server application but the problem is that i cannot send data from CLIENT to SERVER , but i can receive data from SERVER to CLIENT ... Below is mt client and Server code and i also have attached both client and server files...

CLIENT CODE:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Net;
using System.Net.Sockets;
namespace asynclient {

[code]....

View 3 Replies View Related

C/C++ :: Send JPG File From Client To Server?

Feb 27, 2013

Share ur code wit my. m working on windows n using visual studio 2008..

View 1 Replies View Related

C/C++ :: Socket Program That Does Not Work On Windows Server

Apr 1, 2014

I have client-server program that written with c++. Both client and server program are working on my computer.Also, I test it on many computer.There is no problem with it.But, When I try to run that program on the my windows server 2003. I get error which on the below.

[URL] ....

I researched it and someone said that it is related 32-64 bit system . My windows server is 32 bit. And I am compiling as 32 bit. But I still get error , can not get any answer with it.

View 2 Replies View Related

C Sharp :: Socket Server Memory Keeps On Increasing

Apr 23, 2012

We have socket server which is developed in c# .net 3.5.

I see server memory keep on increasing whenver client disconnectes and connects.The server disconnects client if client didn;t send valid credentials.

When client is trying to connect with invalid credentials the memory is keep on increasing.

Here is the code that handles disconnection.

try {  
                            if (state.workSocket != null)  {
                                log.DebugFormat("ssl socket displose,{0},{1}", Doomed, IP);
                                state.workSocket.Shutdown(SocketShutdown.Both);
                                state.workSocket.Close(1);
                                state.workSocket = null;
                                log.DebugFormat("ssl socket displose complete,{0},{1}", Doomed, IP);
                    
[Code] ....

View 7 Replies View Related

C :: Sending Variable From Server To Client Program (with Ack)

Feb 23, 2015

ok to start, windows based program, using pelles c ide

winsock2, using "sample" codes, able to connect, BUT no clue what 1/2 of the codes do, and most of the coding is for nix based systems!

trying to understand, and implement a minimal amount of code to add to a current menu based program!

being able to open connection, wait for input from server, receive input, acknowledge the input, then "act" then return to waiting for new input.

or vice versa, server waiting on client (but then server would have to send all the current status`s to client, so that client could be in real time, prob by sending an array from server to client).

View 11 Replies View Related

C++ :: Enet - How To Make Server And Client For A Game

Feb 1, 2014

So I've just been messing with enet trying to figure out how to make a server and client for a game. I'm having problems whenever the server receives something from a client. For now I'm just trying to send it to all the clients for them to draw the other player, but for some reason whenever I try to an error message comes up saying a breakpoint has been triggered. I don't know why it is happening. This is the code that is giving me problems.

for (unsigned int i = 0; i < peers.size(); i++)
enet_peer_send(peers[0], 0, event.packet);

View 2 Replies View Related

C++ :: Client Sends A Request To Server And Get Some Data

Apr 28, 2014

I want to write a little c++ program that sends a request to a server an get some data. I found the C++ Rest-SDK and decided to use it. I searched on different websites for code-examples but many of them doesn't work an shows syntax errors. What i got now is that code but the client.request method is skipped. The program never jumps in.

#include <Windows.h>
#include <iostream>
#include <sstream>
#include <string>
#include "cpprest/containerstream.h"
#include "cpprest/filestream.h"

[Code] .....

View 1 Replies View Related

C++ :: Insert One Key With Three Values In Map With Client Server Program

Dec 4, 2013

I completed the program but how insert three values without using struct???

Server Program

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <iostream>
#include <netdb.h>
#include <errno.h>
#include<map>

[Code] .....

View 8 Replies View Related

C/C++ :: Trying To Get Server To Send Contents Of Txt File To A Client

Mar 2, 2015

Here is what I got so far, I am not able to send whats in the txt file to the server. Its pretty much a txt file with movie names and when the client types the name, it brings up the movie and its ranking (all from the txt file)

Server Code::

#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <arpa/inet.h>
#include <string.h>
#include <fcntl.h> //file control

[Code] .....

I attached the images of the client and server when I run this, along with the movie.txt file. I cannot seem to get the file to send to the client?

Attached image(s)

View 9 Replies View Related

C/C++ :: Send Contents Of TXT File From Server To Client

Mar 2, 2015

I am not able to send whats in the txt file to the server. Its pretty much a txt file with movie names and when the client types the name, it brings up the movie and its ranking (all from the txt file) .....

Server Code::

#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>

[code]....

I attached the images of the client and server when I run this, alongside the movie.txt file. I cannot seem to get the file to send to the client

View 1 Replies View Related







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