473,779 Members | 1,867 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

VB.NET Winsock Client/Server Data sending Problem

31 New Member
Hello All:
I am developing a client/server application using vb.net winsock programming.
I am sending data to Server and at the same time receive the incoming data from the server.
My application have 3 Windows Forms.
1-FrmInquiry
2-FrmSale
3-FrmBalance
When i send and receive data from FrmInquiry to server it works fine but
My problem is when i go to any other form(ex FrmSale) from FrmInquiry and send data from it to server, it gives error.
but When i run the form FrmSale directly it works fine.
I tried it through Closing socket at Form Unload and initialize its port and IP settings again but no luck.any suggestion?
Another thing is when i close the server & client application and then run it again the FrmInquiry form send data successfully
but again it gives error when i goto FrmSale Form.
How can i send data from one form to another
My code is:

//code for FrmInquiry Form in Load event
tcpclient.remot eport=3000
tcpclient.remot ehost="192.168. 0.10"
tcpclient.conne ct
tcpclient.sendd ata("salman")
dim obj as new FrmSale
obj.show
me.hide

//Code for FrmSale Form in Load event
tcpclient.remot eport=3000
tcpclient.remot ehost="192.168. 0.10"
tcpclient.conne ct
tcpclient.sendd ata("salman")
dim obj as new FrmSale
obj.show
me.hide

//code for frmServer Form in Load event
tcpserver.local port=3000
tcpserver.liste n

//Accept connection request
//Get incomng request from client

Regards:
Danish Majid
May 25 '07 #1
0 1889

Sign in to post your reply or Sign up for a free account.

Similar topics

2
50334
by: Dan | last post by:
I'm writing a simplistic telnet client in VB6 and I've run into a small snag. The program has a textbox to write in the string to be sent using ..SendData and has another textbox that displays what that server sends. When I first connect to the server (in this case, my university's smtp server), I get a response that the server acknowledges my connection. When I type something into the textbox and send it, however, I get no response...
15
4491
by: Michael Rybak | last post by:
hi, everyone. I'm writing a 2-players game that should support network mode. I'm now testing it on 1 PC since I don't have 2. I directly use sockets, and both client and server do computations, the only data transfered is user mouse/kbd input. It works synchronously, but somehow, when I play in client window, both client and server have 17 fps, while when playing in server window, server has 44 fps while client ...
1
31203
by: Dom | last post by:
I'm new to c++. Just started learning it 24 hours ago. Am running into a compile problem. Please, no one waste the effort telling me to google it. I've been researching it for quite a while with no joy. I got dev-c++ and a bit of winsock sample code. I've done nothing out of the ordinary. I could only assume that anyone else that downloaded this software and attempted this would meet with the same result. The problem lies with either the...
1
5432
by: Nicolas Ghesquiere | last post by:
Hello I have a problem with my current program. The meaning of the program is to allow users to login to a server to allow them to access the internet. My program communicates with a MS isa server to make a rule for that IP for the time-credits left for that user. My problem is that so far, the program can handle everything except more then one client, and i have done my best, but i can't find a decent solution
0
986
by: CharChabil | last post by:
Hey Guys Using Winsock application under vb.net 2005 Using same client, i want to connect to many remote servers the Exception that i m facing : "cant not send data while not connected" i knew the problem of this Exception:the client is sending data before being connected to the specified server,hence, can you guys give me a simple hint what to add to slow the commincation(delay),and thus wait the connection to be created,then send the...
5
2905
by: ekosuhanto | last post by:
any body to help me to handle the winsock server hang when the server was sending and receiving after running for 1 - 2 hours. I am using VB (not VB.net). The server will send the data from Comm port every second to many client. I put delay 1 second in the client to send data ack after the client received the data from the server. Any methode to handle this problem?Asyncrounous socket?
1
2635
by: raj.rr7 | last post by:
Hi, I am creating a Http client application using winsock, evc++ 4.0 and K- Jam (WIndows Mobile 5) that will get data from Http server. I am using the following code. WSADATA wsaData; CString csErr; memset(&wsaData, 0, sizeof(WSADATA));
1
1251
by: danishce | last post by:
I am developing a client/server application using vb.net winsock programming. I am sending data to Server and at the same time receive the incoming data from the server. Everything works fine but when i goto next form and send data again to server it gives error. Please help me?
3
7619
AaronL
by: AaronL | last post by:
Hello, I am currently working on a project that has me in sort of a bind. What I want to do is retrieve web pages from the internet, and strip them down to just text. I'll get using Regular Expressions to strip out the HTML code itself, the problem is actually getting the web pages from the internet. I tried using the Microsoft Internet Transfer Control but my client was experiencing problems with some web pages not downloading, this...
0
9474
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10138
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10074
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9930
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6724
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5373
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4037
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3632
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2869
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.