Click here to Skip to main content
15,898,035 members
Home / Discussions / C#
   

C#

 
GeneralRe: System.Runtime.InteropServices.ExternalException: A generic error occurred in GDI+. at System.Drawing.Image.Save Pin
uglyeyes3-Jan-10 1:15
uglyeyes3-Jan-10 1:15 
GeneralRe: System.Runtime.InteropServices.ExternalException: A generic error occurred in GDI+. at System.Drawing.Image.Save Pin
uglyeyes4-Jan-10 1:41
uglyeyes4-Jan-10 1:41 
QuestionBest way to populate this DataGridView Pin
BDJones2-Jan-10 6:50
BDJones2-Jan-10 6:50 
AnswerMessage Closed Pin
2-Jan-10 14:58
stancrm2-Jan-10 14:58 
QuestionRe: Best way to populate this DataGridView [modified] Pin
BDJones3-Jan-10 5:27
BDJones3-Jan-10 5:27 
AnswerRe: Best way to populate this DataGridView Pin
darkelv2-Jan-10 15:52
darkelv2-Jan-10 15:52 
QuestionWhy database.mdf is not filtered in a crystal report while connectiong a database? Pin
CoderForEver2-Jan-10 6:18
CoderForEver2-Jan-10 6:18 
Questionc# sockets [modified] Pin
ikurtz2-Jan-10 5:30
ikurtz2-Jan-10 5:30 
i need some guidance regarding c# winsock programming, im a beginner in programming and network applications. i understand the client/server idea.

server -> socket() bind() listen() accept() {send() recv()} close()

client -> socket() connect() {send() recv()} close()

--

i also know Socket.Connected Property to test if connected.

--

where i am having difficulty is in both server and client how to implement send() and recv() [events]. i know how to send and receive but to do it while keeping the connection seems to very vague in google links.

most examples on google just creat the connection and may send some data or receive some data and the connection is closed.

the while(true) on server runs in a loop and accepts new connections.

i need to know how to implement send and recv (events) so the connected clients and server can keep on exchanging data using the same connection.

lots of the web examples have the server running in a loop and the client makes a new connection whenever data needs to be sent, it doesn't seem efficient to me.

i have also seen server loop running on its own thread to avoid gui lockups but there also the actual communication seems vague.

so. i would like info on how to handle send and recv in a structured manner.

thanks for reading and a very happy new year to you.

---------------------

my current approach is wrong, it concerns blocking.. i should be using .NET asynchronous socket programming.

thanks.

modified on Saturday, January 2, 2010 1:36 PM

AnswerRe: c# sockets Pin
N a v a n e e t h2-Jan-10 6:48
N a v a n e e t h2-Jan-10 6:48 
AnswerRe: c# sockets Pin
Rob Philpott2-Jan-10 6:58
Rob Philpott2-Jan-10 6:58 
QuestionArithmetic operation resulted in an overflow. Pin
3bood.ghzawi2-Jan-10 3:12
3bood.ghzawi2-Jan-10 3:12 
AnswerRe: Arithmetic operation resulted in an overflow. Pin
#realJSOP2-Jan-10 3:39
professional#realJSOP2-Jan-10 3:39 
AnswerRe: Arithmetic operation resulted in an overflow. Pin
Alan N2-Jan-10 3:54
Alan N2-Jan-10 3:54 
GeneralRe: Arithmetic operation resulted in an overflow. Pin
Daniel Grunwald2-Jan-10 10:53
Daniel Grunwald2-Jan-10 10:53 
GeneralRe: Arithmetic operation resulted in an overflow. Pin
harold aptroot2-Jan-10 10:56
harold aptroot2-Jan-10 10:56 
GeneralRe: Arithmetic operation resulted in an overflow. Pin
Daniel Grunwald2-Jan-10 10:58
Daniel Grunwald2-Jan-10 10:58 
GeneralRe: Arithmetic operation resulted in an overflow. Pin
harold aptroot2-Jan-10 11:02
harold aptroot2-Jan-10 11:02 
Questionpassing a form to User Control(dll) from textbox Pin
jojoba20102-Jan-10 0:21
jojoba20102-Jan-10 0:21 
GeneralRe: passing a form to User Control(dll) from textbox Pin
Abhinav S2-Jan-10 0:24
Abhinav S2-Jan-10 0:24 
GeneralRe: passing a form to User Control(dll) from textbox Pin
DaveyM692-Jan-10 2:27
professionalDaveyM692-Jan-10 2:27 
AnswerRe: passing a form to User Control(dll) from textbox Pin
DaveyM692-Jan-10 2:23
professionalDaveyM692-Jan-10 2:23 
QuestionRe: passing a form to User Control(dll) from textbox [modified] Pin
jojoba20102-Jan-10 3:10
jojoba20102-Jan-10 3:10 
QuestionHow to draw a circle in C# Pin
ksaw1231-Jan-10 21:47
ksaw1231-Jan-10 21:47 
AnswerRe: How to draw a circle in C# Pin
venomation1-Jan-10 22:31
venomation1-Jan-10 22:31 
GeneralRe: How to draw a circle in C# Pin
venomation1-Jan-10 22:36
venomation1-Jan-10 22:36 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.