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?
my a book or website where I can make a transition from console programming to GUI programming. I'm totally confused about this. I know how to program in console and can make a whole program based on console. I also know the OPP programming, but it's clear that nobody uses console programming anymore.
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 }
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***/ :
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???
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".
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
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;
I am working on a project that requires using an arduino microcontroller to control the motion of a servo motor. The arduino language is pretty much C.
The original code is of the form:
Code: #include <Servo.h>
Servo myservo; // create servo object to control a servo // a maximum of eight servo objects can be created
int pos = 0; // variable to store the servo position
[Code] .....
But the problem is I don't want the motor's motion to behave linearly (constant increments of the pos variable). My desired motion is a sinusoidal like function. How to approach this?
I am quite new to programming, especially with microcontrollers. My guess is that instead of the pos+=1, I would need something like pos+=sin(argument). I am not sure what that argument should be.
I have researched quite extensively, experimented, and still cannot seem to change the properties of a control on an active winform from a user control.
So I have a user control which populates each dynamically added tab page in a tab control.
I have a textbox in the user control which I would like to type in, capture the text_change event, and change the text of the label in the winform.
How do I bind a DATE column in a DataGridView Control to a DatePicker control (using C#)? I already have the DataGridView control bound to a database stored procedure which takes a DATE value as a parameter and selects joining table based on the results.
I'm attempting to write a little UDP socket library in c++ on linux so a user can just create a new instance of a UDPSocket class, specify destination ip and port, and just connect. Then the user should be able to call send() or receive() in any order they want.. and here I encounter a little problem..
Most of the tutorials for udp socket sending out there include a bind() call when you create your "server" that is supposed to receive data, but the code that send data does not need one. Because I also want my library to support unicast/broadcast/multicast, I have read that I need to set the socket option SO_REUSEADDR on my sockets (since multiple sockets will need to be connected to same destination IP/port for broadcast/multicast)
My question is.. do I need to create 2 socket handles per "UDPSocke in order to make this work? One for sending and one for receiving data? In my code when I try to work with only 1 socket, it is only able to receive stuff from itself on unicast.. Or should I just remove the SO_REUSEADDR when in unicast mode, then try to bind with both sockets, accept that the bind will only work on the 1st socket, and take it from there?
I'm having a bit of trouble learning how to multithread a socket server. I have everything working perfectly fine, but it only accepts one client (I would like multiple clients). some sort of example (I have troubles understanding some things, unless its visual).
I have some paper work to do about a game I should be able to play with my class mates. We should be able to send and recive a struct concerning about the 'moves' of the pieces at the game. This struct is made of 4 ints, simple as that.
I had a previous paper work to do where I'd have to send ints and that was ok, but now that I have to send a struct I'm failing to do so. This is What I've tried:
//SERVER struct message{ int code; int piece; int x; int y; }send; bytes_sent=write(new_socket,&send,sizeof(message)); cout<<bytes_sent;
So far so good, I see 16 as bytes_sent's value.
On the other hand:
//CLIENT struct message{ int code; int piece; int x; int y; }recive; bytes_recvd=read(my_socket,&recive,sizeof(message)); cout<<bytes_recvd;
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Net; using System.Net.Sockets; using System.Threading; namespace test {
[Code] ....
I don't know if this is a bug in Winsock or the .NET Framework but i need to fix this or workaround. Recently I was working on a networking class and this error is breaking everything.
If you add Thread.Sleep(1) after Send() call then "TCP Bug detected" doesnt get executed but its not a reliable fix.
I have written a socket witch send an image 256x256 and now i want to send many images and i don't know what loop to write to make the socket after have sent the first image to send another and not to write the same program many times for every image ......
this is the part that read the binary image
if( !(fp=fopen("Anemos.bmp","rb"))) { printf("Unable to load bin file: %s... ","Anemos.bmp");
All done! Do some stuff now. So what I want to try is get 3 things in this response and put them to string vector but how to do this. What I need is to parse the response and the 200 OK, 28 and All done! Do some stuff now. then put them to string vector.
expected result
response[0] = 200 OK; response[1] = 28 response[2] = All done! Do some stuff now
I Was Try To Change PictureBox To The Memory Stream And Then I Read Memory Stream Bytes And I Send Over The Netwrok Here Is Code
MemoryStream ms = new MemoryStream(); pictureBox1.Image.Save(ms, System.Drawing.Imaging.ImageFormat.Jpeg); // we save the image in side the Memory strem byte[] pic_array = new byte[ms.Length]; ms.Position = 0; ms.Read(pic_array, 0, pic_array.Length); //
[Code]...
but when i want get the Data o mean Bytes from Network tream How can i save in memory stream then dispaly in the picture box ? i try some thing but it is gave me error !
Socket handlerSocket = (Socket)alSockets[alSockets.Count - 1]; NetworkStream networkStream = new NetworkStream(handlerSocket); int thisRead = 0; int blockSize = 1024;
As requested by an exercise I have to write a function which:
- takes as parameter 1 unsigned which represent a timout value, 1 string which represent an IP address and an array containing port's numbers - sends an UDP packet (1024 byte with NULL content) to each pair <IP,port> - waits for the first reply, if it receives a packet within the timeout (set by select() function), the function returns the port of the process who replied, else it returns -1
I think I can do anything of above, but I've not understood how to set and use the select() in this case.
This is my code as it is at the moment
#define BUFLEN 1024 int comUDP ( unsigned timeout, char* ip, int ports[] ) { int s_ds_sock, c_ds_sock; struct sockaddr_in server_socket, client_socket; char msg[BUFLEN] = NULL; //message to send to the clients fd_set fds;
I try to ON and OFF the LED's via parallel port. I connect the cathode of LED's with pin number 18 that is ground and anode of each LED is connected through a 1K resistor to pin 2 to 8. I write the following programe
I'm supposed to make a program that can tell which date, out of any number of dates entered by the user, is the earliest date. However, this is based off another program that I did not do in the last chapter. Since it's a pretty simple program to use as the base for the more "generalized" one, I decided to make the more basic one that can only take two dates, first. If it was just one integer, I could just use date1 for the first date and date2 for the second date, but each date uses 6-8 separate numbers.
how do I tell it something like, "if(date1 < date2)", with date1 and date2 including their month, day, and year. I could do a separate integer name/tag (I forgot what they're called) for each number, but that sounds like doing a lot more adding and subtracting, and like it could easily get messy.Should I, or can I, add all the numbers under the "date" together to see which date has the "lowest number" or "earliest date", or should I somehow handle each number, that is month, day, and year, separately?Here's the code so far:
Code:
include <stdio.h>int main(void) { int date1, date2; printf("Enter first date (mm/dd/yy): "); scanf("%d/%d/%d", &date1); printf("Enter second date (mm/dd/yy): }
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?