07-28-2010
how can I send and receive data in client server socket programing
char name;
printf ("Welcome to the server \n");
printf ("Enter user name: \n");
scanf ("%c", &name);
how can client send name to server:what should be the code?
int send ( int sid , const char ∗buffer Ptr , int len , int f l a g )
how can client receive ack from server:what should be the code?
int recv ( int sid , char ∗buffer Ptr , int len , int flags )
plz help me
10 More Discussions You Might Find Interesting
1. IP Networking
Requirements:
A server program should read a file and send the message to the client . if the file is not there, then switch to the receive part of the same program and receive any messages from the socket. If no messages to receive then switch to send part of the program to... (2 Replies)
Discussion started by: Rajeshsu
2 Replies
2. Programming
Hi,
Am very new to socket programming.
When we use UDP sockets to communicate between two processess,
will both the client/server socket be able to send/recv ?
meaning can sendto()/ recvfrom() be used on both server and client?
It could be useful even if anybody provide some link on socket... (1 Reply)
Discussion started by: rvan
1 Replies
3. UNIX for Dummies Questions & Answers
I'm new to socket programming. Have a basic doubt.
I have a structure(global) at the server side.
I have two different client connecting to the server. Will the changes made by one client on the structure be visible to the other client when it accesses the same client? I'm creating a STREAM... (3 Replies)
Discussion started by: abc.working
3 Replies
4. Programming
Problem
- Linux Client/Server Socket Application: Preventing Client from quitting on server crash
Hi,
I am writing a Linux socket Server and Client using TCP protocol on Ubuntu 9.04 x64.
I am having problem trying to implement a scenario where the client should keep running even when the... (2 Replies)
Discussion started by: varun.nagpaal
2 Replies
5. Shell Programming and Scripting
Hi,
I would like to write a program to receive the GPS data and then send the data via network to other program.
All of the program is not write yet(include host and sender)
All of the server OS is unix or linux
Could you mind to give me some idea to do this?
Thanks so much!
Ken
... (2 Replies)
Discussion started by: kenlok
2 Replies
6. Programming
hei,
i want to enter name and read it by client server socket program after checking name validity put the password and check.if ok than server clirnt say correct other wise incorrect.
below my code:
char name;
printf ("Welcome to the server \n");
printf ("Enter user name: \n");
scanf... (1 Reply)
Discussion started by: saiful_911
1 Replies
7. Post Here to Contact Site Administrators and Moderators
hi,
i am new to socket programming.i have a problem in server.requirement is it should continuosly read the requests from client(sends requests continuously) and after certain delay(i kept der sleep) should send response.
for this i used msgqueues so that after reading it is sending into... (1 Reply)
Discussion started by: chandinisree
1 Replies
8. IP Networking
hi,
i am new to socket programming.i have a problem in server.requirement is it should continuosly read the requests from client(sends requests continuously) and after certain delay(i kept der sleep) should send response.
for this i used msgqueues so that after reading it is sending into... (1 Reply)
Discussion started by: chandinisree
1 Replies
9. Programming
I'm trying to make a "dual/server client" (ipv4,ipv6) with sockets in linux but i don't know how to join both codes. I have a dual client ipv4 and ipv6, but i have problems with the server if you notice the only difference between them it's the AF_INET (pf_inet ipv4, and if_inet6 ipv6) and the port... (3 Replies)
Discussion started by: godna
3 Replies
10. Solaris
Good morning everyone,
I'm looking for some help to retrieve data in a scenario where I might have made a big mistake. I'm hoping to understand what I did wrong.
My system is made of two Solaris 11 Express servers (old free version for evaluation). The first if for data and the second is... (7 Replies)
Discussion started by: rnd
7 Replies
LEARN ABOUT CENTOS
xiqueryversion
XIQUERYVERSION(3) XIQUERYVERSION(3)
NAME
XIQueryVersion - announce and query the support XI2 version.
SYNOPSIS
#include <X11/extensions/XInput2.h>
Status XIQueryVersion( Display *display,
int *major_version_inout,
int *minor_version_inout);
display
Specifies the connection to the X server.
major_version_inout
Specifies the client's supported XI2 version, and
returns the server's supported version.
minor_version_inout
Specifies the client's supported XI2 version, and
returns the server's supported version.
DESCRIPTION
XIQueryVersion announces the client's supported XI2 version to
the server and returns server's supported X Input version. Clients
are required to use XIQueryVersion instead of XGetExtensionVersion
if they use XI2 calls. The server may treat a client differently
depending on the supported version announced by the client.
The major_version_inout must be 2 or greater, otherwise a BadValue
error occurs.
If the server does not support XI2, XIQueryVersion returns BadRequest
to the client. Otherwise, XIQueryVersion returns Success. In both
cases major_version_inout and minor_version_inout are set to the
server's supported version.
Consecutive calls to XIQueryVersion by the same client always return the
first returned major.minor version. If the client requests a version
lower than the first returned major.minor version in a subsequent call, a
BadValue error occurs.
XIQueryVersion can generate a BadValue error.
EXAMPLES
int rc;
int major = 2;
int minor = 0;
rc = XIQueryVersion(dpy, &major, &minor);
if (rc == Success)
printf("XI2 supported. (%d.%d)
", major, minor);
else if (rc == BadRequest)
printf("No XI2 support. (%d.%d only)
", major, minor);
else
printf("Internal error
");
DIAGNOSTICS
BadValue
A value is outside of the permitted range.
03/09/2013 XIQUERYVERSION(3)